A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

This commit is contained in:
github-actions[bot]
2024-09-02 21:15:39 +00:00
parent b8896127c8
commit 5deff7614f
8 changed files with 4742 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,81 @@
import { isDesktop } from 'lib/isDesktop'
/// FileSystemManager is a class that provides a way to read files from the local file system.
/// It assumes that you are in a project since it is solely used by the std lib
/// when executing code.
class FileSystemManager {
private _dir: string | null = null
get dir() {
return this._dir ?? ''
}
set dir(dir: string) {
this._dir = dir
}
async join(dir: string, path: string): Promise<string> {
return Promise.resolve(window.electron.path.join(dir, path))
}
async readFile(path: string): Promise<Uint8Array | void> {
// Using local file system only works from desktop.
if (!isDesktop()) {
return Promise.reject(
new Error(
'This function can only be called from the desktop application'
)
)
}
return this.join(this.dir, path).then((filePath) => {
return window.electron.readFile(filePath)
})
}
async exists(path: string): Promise<boolean | void> {
// Using local file system only works from desktop.
if (!isDesktop()) {
return Promise.reject(
new Error(
'This function can only be called from the desktop application'
)
)
}
return this.join(this.dir, path).then(async (file) => {
try {
await window.electron.stat(file)
} catch (e) {
if (e === 'ENOENT') {
return false
}
}
return true
})
}
async getAllFiles(path: string): Promise<string[] | void> {
// Using local file system only works from desktop.
if (!isDesktop()) {
return Promise.reject(
new Error(
'This function can only be called from the desktop application'
)
)
}
return this.join(this.dir, path).then((filepath) => {
return window.electron
.readdir(filepath)
.catch((error: Error) => {
return Promise.reject(new Error(`Error reading dir: ${error}`))
})
.then((files: string[]) => {
return files.map((filePath) => filePath)
})
})
}
}
export const fileSystemManager = new FileSystemManager()

View File

@ -0,0 +1,425 @@
import { CommandLog, EngineCommandManager } from 'lang/std/engineConnection'
import { WebrtcStats } from 'wasm-lib/kcl/bindings/WebrtcStats'
import { OsInfo } from 'wasm-lib/kcl/bindings/OsInfo'
import { isDesktop } from 'lib/isDesktop'
import { APP_VERSION } from 'routes/Settings'
import { UAParser } from 'ua-parser-js'
import screenshot from 'lib/screenshot'
import { VITE_KC_API_BASE_URL } from 'env'
import CodeManager from 'lang/codeManager'
/* eslint-disable suggest-no-throw/suggest-no-throw --
* All the throws in CoreDumpManager are intentional and should be caught and handled properly
* by the calling Promises with a catch block. The throws are essential to properly handling
* when the app isn't ready enough or otherwise unable to produce a core dump. By throwing
* instead of simply erroring, the code halts execution at the first point which it cannot
* complete the core dump request.
**/
/**
* CoreDumpManager module
* - for getting all the values from the JS world to pass to the Rust world for a core dump.
* @module lib/coredump
* @class
*/
// CoreDumpManager is instantiated in ModelingMachineProvider and passed to coreDump() in wasm.ts
// The async function coreDump() handles any errors thrown in its Promise catch method and rethrows
// them to so the toast handler in ModelingMachineProvider can show the user an error message toast
// TODO: Throw more
export class CoreDumpManager {
engineCommandManager: EngineCommandManager
codeManager: CodeManager
token: string | undefined
baseUrl: string = VITE_KC_API_BASE_URL
constructor(
engineCommandManager: EngineCommandManager,
codeManager: CodeManager,
token: string | undefined
) {
this.engineCommandManager = engineCommandManager
this.codeManager = codeManager
this.token = token
}
// Get the token.
authToken(): string {
if (!this.token) {
throw new Error('Token not set')
}
return this.token
}
// Get the base url.
baseApiUrl(): string {
return this.baseUrl
}
// Get the version of the app from the package.json.
version(): string {
return APP_VERSION
}
kclCode(): string {
return this.codeManager.code
}
// Get the backend pool we've requested.
pool(): string {
return this.engineCommandManager.settings.pool || ''
}
// Get the os information.
getOsInfo(): string {
if (this.isDesktop()) {
const osinfo: OsInfo = {
platform: window.electron.platform ?? null,
arch: window.electron.arch ?? null,
browser: 'desktop',
version: window.electron.version ?? null,
}
return JSON.stringify(osinfo)
}
const userAgent = window.navigator.userAgent || 'unknown browser'
if (userAgent === 'unknown browser') {
const osinfo: OsInfo = {
platform: userAgent,
arch: userAgent,
version: userAgent,
browser: userAgent,
}
return JSON.stringify(osinfo)
}
const parser = new UAParser(userAgent)
const parserResults = parser.getResult()
const osinfo: OsInfo = {
platform: parserResults.os.name || userAgent,
arch: parserResults.cpu.architecture || userAgent,
version: parserResults.os.version || userAgent,
browser: userAgent,
}
return JSON.stringify(osinfo)
}
isDesktop(): boolean {
return isDesktop()
}
getWebrtcStats(): Promise<string> {
if (!this.engineCommandManager.engineConnection) {
// when the engine connection is not available, return an empty object.
return Promise.resolve(JSON.stringify({}))
}
if (!this.engineCommandManager.engineConnection.webrtcStatsCollector) {
// when the engine connection is not available, return an empty object.
return Promise.resolve(JSON.stringify({}))
}
return this.engineCommandManager.engineConnection
.webrtcStatsCollector()
.catch((error: any) => {
throw new Error(`Error getting webrtc stats: ${error}`)
})
.then((stats: any) => {
const webrtcStats: WebrtcStats = {
packets_lost: stats.rtc_packets_lost,
frames_received: stats.rtc_frames_received,
frame_width: stats.rtc_frame_width,
frame_height: stats.rtc_frame_height,
frame_rate: stats.rtc_frames_per_second,
key_frames_decoded: stats.rtc_keyframes_decoded,
frames_dropped: stats.rtc_frames_dropped,
pause_count: stats.rtc_pause_count,
total_pauses_duration: stats.rtc_total_pauses_duration_sec,
freeze_count: stats.rtc_freeze_count,
total_freezes_duration: stats.rtc_total_freezes_duration_sec,
pli_count: stats.rtc_pli_count,
jitter: stats.rtc_jitter_sec,
}
return JSON.stringify(webrtcStats)
})
}
// Currently just a placeholder to begin loading singleton and xstate data into
getClientState(): Promise<string> {
/**
* Check if a function is private method
*/
const isPrivateMethod = (key: string) => {
return key.length && key[0] === '_'
}
// Turn off verbose logging by default
const verboseLogging = false
/**
* Toggle verbose debug logging of step-by-step client state coredump data
*/
const debugLog = verboseLogging ? console.log : () => {}
console.warn('CoreDump: Gathering client state')
// Initialize the clientState object
let clientState = {
// singletons
engine_command_manager: {
artifact_map: {},
command_logs: [] as CommandLog[],
engine_connection: { state: { type: '' } },
default_planes: {},
scene_command_artifacts: {},
},
kcl_manager: {
ast: {},
kcl_errors: [],
},
scene_infra: {},
scene_entities_manager: {},
editor_manager: {},
// xstate
auth_machine: {},
command_bar_machine: {},
file_machine: {},
home_machine: {},
modeling_machine: {},
settings_machine: {},
}
debugLog('CoreDump: initialized clientState', clientState)
debugLog('CoreDump: globalThis.window', globalThis.window)
try {
// Singletons
// engine_command_manager
debugLog('CoreDump: engineCommandManager', this.engineCommandManager)
// artifact map - this.engineCommandManager.artifactGraph
if (this.engineCommandManager?.artifactGraph) {
debugLog(
'CoreDump: Engine Command Manager artifact map',
this.engineCommandManager.artifactGraph
)
clientState.engine_command_manager.artifact_map = structuredClone(
this.engineCommandManager.artifactGraph
)
}
// command logs - this.engineCommandManager.commandLogs
if (this.engineCommandManager?.commandLogs) {
debugLog(
'CoreDump: Engine Command Manager command logs',
this.engineCommandManager.commandLogs
)
clientState.engine_command_manager.command_logs = structuredClone(
this.engineCommandManager.commandLogs
)
}
// default planes - this.engineCommandManager.defaultPlanes
if (this.engineCommandManager?.defaultPlanes) {
debugLog(
'CoreDump: Engine Command Manager default planes',
this.engineCommandManager.defaultPlanes
)
clientState.engine_command_manager.default_planes = structuredClone(
this.engineCommandManager.defaultPlanes
)
}
// engine connection state
if (this.engineCommandManager?.engineConnection?.state) {
debugLog(
'CoreDump: Engine Command Manager engine connection state',
this.engineCommandManager.engineConnection.state
)
clientState.engine_command_manager.engine_connection.state =
this.engineCommandManager.engineConnection.state
}
// in sequence - this.engineCommandManager.inSequence
if (this.engineCommandManager?.inSequence) {
debugLog(
'CoreDump: Engine Command Manager in sequence',
this.engineCommandManager.inSequence
)
;(clientState.engine_command_manager as any).in_sequence =
this.engineCommandManager.inSequence
}
// out sequence - this.engineCommandManager.outSequence
if (this.engineCommandManager?.outSequence) {
debugLog(
'CoreDump: Engine Command Manager out sequence',
this.engineCommandManager.outSequence
)
;(clientState.engine_command_manager as any).out_sequence =
this.engineCommandManager.outSequence
}
// KCL Manager - globalThis?.window?.kclManager
const kclManager = (globalThis?.window as any)?.kclManager
debugLog('CoreDump: kclManager', kclManager)
if (kclManager) {
// KCL Manager AST
debugLog('CoreDump: KCL Manager AST', kclManager?.ast)
if (kclManager?.ast) {
clientState.kcl_manager.ast = structuredClone(kclManager.ast)
}
// KCL Errors
debugLog('CoreDump: KCL Errors', kclManager?.kclErrors)
if (kclManager?.kclErrors) {
clientState.kcl_manager.kcl_errors = structuredClone(
kclManager.kclErrors
)
}
// KCL isExecuting
debugLog('CoreDump: KCL isExecuting', kclManager?.isExecuting)
if (kclManager?.isExecuting) {
;(clientState.kcl_manager as any).isExecuting = kclManager.isExecuting
}
// KCL logs
debugLog('CoreDump: KCL logs', kclManager?.logs)
if (kclManager?.logs) {
;(clientState.kcl_manager as any).logs = structuredClone(
kclManager.logs
)
}
// KCL programMemory
debugLog('CoreDump: KCL programMemory', kclManager?.programMemory)
if (kclManager?.programMemory) {
;(clientState.kcl_manager as any).programMemory = structuredClone(
kclManager.programMemory
)
}
// KCL wasmInitFailed
debugLog('CoreDump: KCL wasmInitFailed', kclManager?.wasmInitFailed)
if (kclManager?.wasmInitFailed) {
;(clientState.kcl_manager as any).wasmInitFailed =
kclManager.wasmInitFailed
}
}
// Scene Infra - globalThis?.window?.sceneInfra
const sceneInfra = (globalThis?.window as any)?.sceneInfra
debugLog('CoreDump: Scene Infra', sceneInfra)
if (sceneInfra) {
const sceneInfraSkipKeys = ['camControls']
const sceneInfraKeys = Object.keys(sceneInfra)
.sort()
.filter((entry) => {
return (
typeof sceneInfra[entry] !== 'function' &&
!sceneInfraSkipKeys.includes(entry)
)
})
debugLog('CoreDump: Scene Infra keys', sceneInfraKeys)
sceneInfraKeys.forEach((key: string) => {
debugLog('CoreDump: Scene Infra', key, sceneInfra[key])
try {
;(clientState.scene_infra as any)[key] = sceneInfra[key]
} catch (error) {
console.error(
'CoreDump: unable to parse Scene Infra ' + key + ' data due to ',
error
)
}
})
}
// Scene Entities Manager - globalThis?.window?.sceneEntitiesManager
const sceneEntitiesManager = (globalThis?.window as any)
?.sceneEntitiesManager
debugLog('CoreDump: sceneEntitiesManager', sceneEntitiesManager)
if (sceneEntitiesManager) {
// Scene Entities Manager active segments
debugLog(
'CoreDump: Scene Entities Manager active segments',
sceneEntitiesManager?.activeSegments
)
if (sceneEntitiesManager?.activeSegments) {
;(clientState.scene_entities_manager as any).activeSegments =
structuredClone(sceneEntitiesManager.activeSegments)
}
}
// Editor Manager - globalThis?.window?.editorManager
const editorManager = (globalThis?.window as any)?.editorManager
debugLog('CoreDump: editorManager', editorManager)
if (editorManager) {
const editorManagerSkipKeys = ['camControls']
const editorManagerKeys = Object.keys(editorManager)
.sort()
.filter((entry) => {
return (
typeof editorManager[entry] !== 'function' &&
!isPrivateMethod(entry) &&
!editorManagerSkipKeys.includes(entry)
)
})
debugLog('CoreDump: Editor Manager keys', editorManagerKeys)
editorManagerKeys.forEach((key: string) => {
debugLog('CoreDump: Editor Manager', key, editorManager[key])
try {
;(clientState.editor_manager as any)[key] = structuredClone(
editorManager[key]
)
} catch (error) {
console.error(
'CoreDump: unable to parse Editor Manager ' +
key +
' data due to ',
error
)
}
})
}
// enableMousePositionLogs - Not coredumped
// See https://github.com/KittyCAD/modeling-app/issues/2338#issuecomment-2136441998
debugLog(
'CoreDump: enableMousePositionLogs [not coredumped]',
(globalThis?.window as any)?.enableMousePositionLogs
)
// XState Machines
debugLog(
'CoreDump: xstate services',
(globalThis?.window as any)?.__xstate__?.services
)
debugLog('CoreDump: final clientState', clientState)
const clientStateJson = JSON.stringify(clientState)
debugLog('CoreDump: final clientState JSON', clientStateJson)
return Promise.resolve(clientStateJson)
} catch (error) {
console.error('CoreDump: unable to return data due to ', error)
return Promise.reject(JSON.stringify(error))
}
}
// Return a data URL (png format) of the screenshot of the current page.
screenshot(): Promise<string> {
return (
screenshot()
.then((screenshotStr: string) => screenshotStr)
// maybe rust should handle an error, but an empty string at least doesn't cause the core dump to fail entirely
.catch((error: any) => ``)
)
}
}

View File

@ -0,0 +1,19 @@
{
"name": "wasm-lib",
"type": "module",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "https://github.com/KittyCAD/modeling-app"
},
"files": [
"wasm_lib_bg.wasm",
"wasm_lib.js",
"wasm_lib.d.ts"
],
"main": "wasm_lib.js",
"types": "wasm_lib.d.ts",
"sideEffects": [
"./snippets/*"
]
}

339
src/wasm-lib/pkg/wasm_lib.d.ts vendored Normal file
View File

@ -0,0 +1,339 @@
/* tslint:disable */
/* eslint-disable */
/**
* @param {string} json
* @returns {string}
*/
export function toml_stringify(json: string): string;
/**
* @param {string} program_str
* @param {string} memory_str
* @param {string} units
* @param {any} engine_manager
* @param {any} fs_manager
* @param {boolean} is_mock
* @returns {Promise<any>}
*/
export function execute_wasm(program_str: string, memory_str: string, units: string, engine_manager: any, fs_manager: any, is_mock: boolean): Promise<any>;
/**
* @param {string} program_str
* @returns {Promise<any>}
*/
export function kcl_lint(program_str: string): Promise<any>;
/**
* @param {any} engine_manager
* @returns {Promise<any>}
*/
export function make_default_planes(engine_manager: any): Promise<any>;
/**
* @param {any} engine_manager
* @param {boolean} hidden
* @returns {Promise<void>}
*/
export function modify_grid(engine_manager: any, hidden: boolean): Promise<void>;
/**
* @param {any} manager
* @param {string} program_str
* @param {string} sketch_name
* @param {string} plane_type
* @param {string} sketch_id
* @returns {Promise<any>}
*/
export function modify_ast_for_sketch_wasm(manager: any, program_str: string, sketch_name: string, plane_type: string, sketch_id: string): Promise<any>;
/**
* @param {Uint8Array} data
* @returns {any}
*/
export function deserialize_files(data: Uint8Array): any;
/**
* @param {string} js
* @returns {any}
*/
export function lexer_wasm(js: string): any;
/**
* @param {string} js
* @returns {any}
*/
export function parse_wasm(js: string): any;
/**
* @param {string} json_str
* @returns {any}
*/
export function recast_wasm(json_str: string): any;
/**
* Run the `kcl` lsp server.
* @param {ServerConfig} config
* @param {any | undefined} engine_manager
* @param {string} units
* @param {string} token
* @param {string} baseurl
* @returns {Promise<void>}
*/
export function kcl_lsp_run(config: ServerConfig, engine_manager: any | undefined, units: string, token: string, baseurl: string): Promise<void>;
/**
* Run the `copilot` lsp server.
* @param {ServerConfig} config
* @param {string} token
* @param {string} baseurl
* @returns {Promise<void>}
*/
export function copilot_lsp_run(config: ServerConfig, token: string, baseurl: string): Promise<void>;
/**
* @param {Float64Array} points
* @returns {number}
*/
export function is_points_ccw(points: Float64Array): number;
/**
* @param {number} arc_start_point_x
* @param {number} arc_start_point_y
* @param {number} arc_end_point_x
* @param {number} arc_end_point_y
* @param {number} tan_previous_point_x
* @param {number} tan_previous_point_y
* @param {boolean} obtuse
* @returns {TangentialArcInfoOutputWasm}
*/
export function get_tangential_arc_to_info(arc_start_point_x: number, arc_start_point_y: number, arc_end_point_x: number, arc_end_point_y: number, tan_previous_point_x: number, tan_previous_point_y: number, obtuse: boolean): TangentialArcInfoOutputWasm;
/**
* Create the default program memory.
* @returns {any}
*/
export function program_memory_init(): any;
/**
* Get a coredump.
* @param {any} core_dump_manager
* @returns {Promise<any>}
*/
export function coredump(core_dump_manager: any): Promise<any>;
/**
* Get the default app settings.
* @returns {any}
*/
export function default_app_settings(): any;
/**
* Parse the app settings.
* @param {string} toml_str
* @returns {any}
*/
export function parse_app_settings(toml_str: string): any;
/**
* Get the default project settings.
* @returns {any}
*/
export function default_project_settings(): any;
/**
* Parse (deserialize) the project settings.
* @param {string} toml_str
* @returns {any}
*/
export function parse_project_settings(toml_str: string): any;
/**
* Serialize the project settings.
* @param {any} val
* @returns {any}
*/
export function serialize_project_settings(val: any): any;
/**
* Base64 decode a string.
* @param {string} input
* @returns {Uint8Array}
*/
export function base64_decode(input: string): Uint8Array;
/**
*/
export class IntoUnderlyingByteSource {
free(): void;
/**
* @param {ReadableByteStreamController} controller
*/
start(controller: ReadableByteStreamController): void;
/**
* @param {ReadableByteStreamController} controller
* @returns {Promise<any>}
*/
pull(controller: ReadableByteStreamController): Promise<any>;
/**
*/
cancel(): void;
/**
*/
readonly autoAllocateChunkSize: number;
/**
*/
readonly type: string;
}
/**
*/
export class IntoUnderlyingSink {
free(): void;
/**
* @param {any} chunk
* @returns {Promise<any>}
*/
write(chunk: any): Promise<any>;
/**
* @returns {Promise<any>}
*/
close(): Promise<any>;
/**
* @param {any} reason
* @returns {Promise<any>}
*/
abort(reason: any): Promise<any>;
}
/**
*/
export class IntoUnderlyingSource {
free(): void;
/**
* @param {ReadableStreamDefaultController} controller
* @returns {Promise<any>}
*/
pull(controller: ReadableStreamDefaultController): Promise<any>;
/**
*/
cancel(): void;
}
/**
*/
export class ServerConfig {
free(): void;
/**
* @param {AsyncIterator<any>} into_server
* @param {WritableStream} from_server
* @param {any} fs
*/
constructor(into_server: AsyncIterator<any>, from_server: WritableStream, fs: any);
}
/**
*/
export class TangentialArcInfoOutputWasm {
free(): void;
/**
* The length of the arc.
*/
arc_length: number;
/**
* The midpoint of the arc x.
*/
arc_mid_point_x: number;
/**
* The midpoint of the arc y.
*/
arc_mid_point_y: number;
/**
* Flag to determine if the arc is counter clockwise.
*/
ccw: number;
/**
* The geometric center of the arc x.
*/
center_x: number;
/**
* The geometric center of the arc y.
*/
center_y: number;
/**
* End angle of the arc in radians.
*/
end_angle: number;
/**
* The radius of the arc.
*/
radius: number;
/**
* Start angle of the arc in radians.
*/
start_angle: number;
}
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly toml_stringify: (a: number, b: number, c: number) => void;
readonly execute_wasm: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
readonly kcl_lint: (a: number, b: number) => number;
readonly make_default_planes: (a: number) => number;
readonly modify_grid: (a: number, b: number) => number;
readonly modify_ast_for_sketch_wasm: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
readonly deserialize_files: (a: number, b: number, c: number) => void;
readonly lexer_wasm: (a: number, b: number, c: number) => void;
readonly parse_wasm: (a: number, b: number, c: number) => void;
readonly recast_wasm: (a: number, b: number, c: number) => void;
readonly __wbg_serverconfig_free: (a: number) => void;
readonly serverconfig_new: (a: number, b: number, c: number) => number;
readonly kcl_lsp_run: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
readonly copilot_lsp_run: (a: number, b: number, c: number, d: number, e: number) => number;
readonly is_points_ccw: (a: number, b: number) => number;
readonly __wbg_tangentialarcinfooutputwasm_free: (a: number) => void;
readonly __wbg_get_tangentialarcinfooutputwasm_center_x: (a: number) => number;
readonly __wbg_set_tangentialarcinfooutputwasm_center_x: (a: number, b: number) => void;
readonly __wbg_get_tangentialarcinfooutputwasm_center_y: (a: number) => number;
readonly __wbg_set_tangentialarcinfooutputwasm_center_y: (a: number, b: number) => void;
readonly __wbg_get_tangentialarcinfooutputwasm_arc_mid_point_x: (a: number) => number;
readonly __wbg_set_tangentialarcinfooutputwasm_arc_mid_point_x: (a: number, b: number) => void;
readonly __wbg_get_tangentialarcinfooutputwasm_arc_mid_point_y: (a: number) => number;
readonly __wbg_set_tangentialarcinfooutputwasm_arc_mid_point_y: (a: number, b: number) => void;
readonly __wbg_get_tangentialarcinfooutputwasm_radius: (a: number) => number;
readonly __wbg_set_tangentialarcinfooutputwasm_radius: (a: number, b: number) => void;
readonly __wbg_get_tangentialarcinfooutputwasm_start_angle: (a: number) => number;
readonly __wbg_set_tangentialarcinfooutputwasm_start_angle: (a: number, b: number) => void;
readonly __wbg_get_tangentialarcinfooutputwasm_end_angle: (a: number) => number;
readonly __wbg_set_tangentialarcinfooutputwasm_end_angle: (a: number, b: number) => void;
readonly __wbg_get_tangentialarcinfooutputwasm_ccw: (a: number) => number;
readonly __wbg_set_tangentialarcinfooutputwasm_ccw: (a: number, b: number) => void;
readonly __wbg_get_tangentialarcinfooutputwasm_arc_length: (a: number) => number;
readonly __wbg_set_tangentialarcinfooutputwasm_arc_length: (a: number, b: number) => void;
readonly get_tangential_arc_to_info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
readonly program_memory_init: (a: number) => void;
readonly coredump: (a: number) => number;
readonly default_app_settings: (a: number) => void;
readonly parse_app_settings: (a: number, b: number, c: number) => void;
readonly default_project_settings: (a: number) => void;
readonly parse_project_settings: (a: number, b: number, c: number) => void;
readonly serialize_project_settings: (a: number, b: number) => void;
readonly base64_decode: (a: number, b: number, c: number) => void;
readonly __wbg_intounderlyingsource_free: (a: number) => void;
readonly intounderlyingsource_pull: (a: number, b: number) => number;
readonly intounderlyingsource_cancel: (a: number) => void;
readonly __wbg_intounderlyingsink_free: (a: number) => void;
readonly intounderlyingsink_write: (a: number, b: number) => number;
readonly intounderlyingsink_close: (a: number) => number;
readonly intounderlyingsink_abort: (a: number, b: number) => number;
readonly __wbg_intounderlyingbytesource_free: (a: number) => void;
readonly intounderlyingbytesource_type: (a: number, b: number) => void;
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
readonly intounderlyingbytesource_start: (a: number, b: number) => void;
readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
readonly intounderlyingbytesource_cancel: (a: number) => void;
readonly __wbindgen_malloc: (a: number, b: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
readonly __wbindgen_export_2: WebAssembly.Table;
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h441a9e3e174bc8f1: (a: number, b: number, c: number) => void;
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
readonly __wbindgen_exn_store: (a: number) => void;
readonly wasm_bindgen__convert__closures__invoke2_mut__h38ba35493531eafd: (a: number, b: number, c: number, d: number) => void;
}
export type SyncInitInput = BufferSource | WebAssembly.Module;
/**
* Instantiates the given `module`, which can either be bytes or
* a precompiled `WebAssembly.Module`.
*
* @param {SyncInitInput} module
*
* @returns {InitOutput}
*/
export function initSync(module: SyncInitInput): InitOutput;
/**
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
* for everything else, calls `WebAssembly.instantiate` directly.
*
* @param {InitInput | Promise<InitInput>} module_or_path
*
* @returns {Promise<InitOutput>}
*/
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;

1667
src/wasm-lib/pkg/wasm_lib.js Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

67
src/wasm-lib/pkg/wasm_lib_bg.wasm.d.ts vendored Normal file
View File

@ -0,0 +1,67 @@
/* tslint:disable */
/* eslint-disable */
export const memory: WebAssembly.Memory;
export function toml_stringify(a: number, b: number, c: number): void;
export function execute_wasm(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number): number;
export function kcl_lint(a: number, b: number): number;
export function make_default_planes(a: number): number;
export function modify_grid(a: number, b: number): number;
export function modify_ast_for_sketch_wasm(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number): number;
export function deserialize_files(a: number, b: number, c: number): void;
export function lexer_wasm(a: number, b: number, c: number): void;
export function parse_wasm(a: number, b: number, c: number): void;
export function recast_wasm(a: number, b: number, c: number): void;
export function __wbg_serverconfig_free(a: number): void;
export function serverconfig_new(a: number, b: number, c: number): number;
export function kcl_lsp_run(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
export function copilot_lsp_run(a: number, b: number, c: number, d: number, e: number): number;
export function is_points_ccw(a: number, b: number): number;
export function __wbg_tangentialarcinfooutputwasm_free(a: number): void;
export function __wbg_get_tangentialarcinfooutputwasm_center_x(a: number): number;
export function __wbg_set_tangentialarcinfooutputwasm_center_x(a: number, b: number): void;
export function __wbg_get_tangentialarcinfooutputwasm_center_y(a: number): number;
export function __wbg_set_tangentialarcinfooutputwasm_center_y(a: number, b: number): void;
export function __wbg_get_tangentialarcinfooutputwasm_arc_mid_point_x(a: number): number;
export function __wbg_set_tangentialarcinfooutputwasm_arc_mid_point_x(a: number, b: number): void;
export function __wbg_get_tangentialarcinfooutputwasm_arc_mid_point_y(a: number): number;
export function __wbg_set_tangentialarcinfooutputwasm_arc_mid_point_y(a: number, b: number): void;
export function __wbg_get_tangentialarcinfooutputwasm_radius(a: number): number;
export function __wbg_set_tangentialarcinfooutputwasm_radius(a: number, b: number): void;
export function __wbg_get_tangentialarcinfooutputwasm_start_angle(a: number): number;
export function __wbg_set_tangentialarcinfooutputwasm_start_angle(a: number, b: number): void;
export function __wbg_get_tangentialarcinfooutputwasm_end_angle(a: number): number;
export function __wbg_set_tangentialarcinfooutputwasm_end_angle(a: number, b: number): void;
export function __wbg_get_tangentialarcinfooutputwasm_ccw(a: number): number;
export function __wbg_set_tangentialarcinfooutputwasm_ccw(a: number, b: number): void;
export function __wbg_get_tangentialarcinfooutputwasm_arc_length(a: number): number;
export function __wbg_set_tangentialarcinfooutputwasm_arc_length(a: number, b: number): void;
export function get_tangential_arc_to_info(a: number, b: number, c: number, d: number, e: number, f: number, g: number): number;
export function program_memory_init(a: number): void;
export function coredump(a: number): number;
export function default_app_settings(a: number): void;
export function parse_app_settings(a: number, b: number, c: number): void;
export function default_project_settings(a: number): void;
export function parse_project_settings(a: number, b: number, c: number): void;
export function serialize_project_settings(a: number, b: number): void;
export function base64_decode(a: number, b: number, c: number): void;
export function __wbg_intounderlyingsource_free(a: number): void;
export function intounderlyingsource_pull(a: number, b: number): number;
export function intounderlyingsource_cancel(a: number): void;
export function __wbg_intounderlyingsink_free(a: number): void;
export function intounderlyingsink_write(a: number, b: number): number;
export function intounderlyingsink_close(a: number): number;
export function intounderlyingsink_abort(a: number, b: number): number;
export function __wbg_intounderlyingbytesource_free(a: number): void;
export function intounderlyingbytesource_type(a: number, b: number): void;
export function intounderlyingbytesource_autoAllocateChunkSize(a: number): number;
export function intounderlyingbytesource_start(a: number, b: number): void;
export function intounderlyingbytesource_pull(a: number, b: number): number;
export function intounderlyingbytesource_cancel(a: number): void;
export function __wbindgen_malloc(a: number, b: number): number;
export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
export const __wbindgen_export_2: WebAssembly.Table;
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h441a9e3e174bc8f1(a: number, b: number, c: number): void;
export function __wbindgen_add_to_stack_pointer(a: number): number;
export function __wbindgen_free(a: number, b: number, c: number): void;
export function __wbindgen_exn_store(a: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h38ba35493531eafd(a: number, b: number, c: number, d: number): void;