@net-vim/core 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1126 -954
- package/dist/src/VimEditor.d.ts +5 -0
- package/dist/src/VimUI.d.ts +55 -0
- package/dist/src/WebGLRenderer.d.ts +19 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/line-numbers-plugin.d.ts +11 -0
- package/dist/src/opfs-util.d.ts +15 -0
- package/dist/src/plugin-manager.d.ts +42 -0
- package/dist/src/plugin-manager.test.d.ts +1 -0
- package/dist/src/prelude/context-menu.d.ts +8 -0
- package/dist/src/prelude/eruda.d.ts +8 -0
- package/dist/src/prelude/external-fs.d.ts +8 -0
- package/dist/src/prelude/hello.d.ts +8 -0
- package/dist/src/prelude/line-numbers.d.ts +10 -0
- package/dist/src/prelude/ts-lsp-worker.d.ts +1 -0
- package/dist/src/prelude/ts-lsp.d.ts +8 -0
- package/dist/src/prelude.d.ts +1 -0
- package/dist/src/solid-universal-tui/index.d.ts +24 -0
- package/dist/src/solid-universal-tui/jsx-dev-runtime.d.ts +1 -0
- package/dist/src/solid-universal-tui/jsx-runtime.d.ts +1 -0
- package/dist/src/types.d.ts +137 -0
- package/dist/src/utils.d.ts +4 -0
- package/dist/src/vim-engine.d.ts +63 -0
- package/dist/src/vim-engine.test.d.ts +1 -0
- package/dist/src/wasm/tui_engine.d.ts +46 -0
- package/package.json +6 -4
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Component } from 'solid-js';
|
|
2
|
+
import { VimMode, GutterOptions, LineRendererOptions } from './types';
|
|
3
|
+
interface VimUIProps {
|
|
4
|
+
buffer: string[] | (() => string[]);
|
|
5
|
+
cursor: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
} | (() => {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
});
|
|
12
|
+
visualStart?: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
} | null | (() => {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
} | null);
|
|
19
|
+
topLine?: number | (() => number);
|
|
20
|
+
leftCol?: number | (() => number);
|
|
21
|
+
mode: VimMode | (() => VimMode);
|
|
22
|
+
commandText: string | (() => string);
|
|
23
|
+
commandCursorX?: number | (() => number);
|
|
24
|
+
width: number | (() => number);
|
|
25
|
+
height: number | (() => number);
|
|
26
|
+
currentFilePath?: string | null | (() => string | null);
|
|
27
|
+
isExplorer?: boolean | (() => boolean);
|
|
28
|
+
explorerPath?: string | (() => string);
|
|
29
|
+
isReadOnly?: boolean | (() => boolean);
|
|
30
|
+
plugins?: Array<{
|
|
31
|
+
name: string;
|
|
32
|
+
}> | (() => Array<{
|
|
33
|
+
name: string;
|
|
34
|
+
}>);
|
|
35
|
+
gutters?: GutterOptions[] | (() => GutterOptions[]);
|
|
36
|
+
lineRenderers?: LineRendererOptions[] | (() => LineRendererOptions[]);
|
|
37
|
+
completionItems?: any[] | (() => any[]);
|
|
38
|
+
selectedCompletionIndex?: number | (() => number);
|
|
39
|
+
hoverText?: string | null | (() => string | null);
|
|
40
|
+
hoverPos?: {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
} | (() => {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
});
|
|
47
|
+
statusMessage?: string | null | (() => string | null);
|
|
48
|
+
wrap: boolean | (() => boolean);
|
|
49
|
+
onCursorChange?: (cursor: {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
}) => void;
|
|
53
|
+
}
|
|
54
|
+
export declare const VimUI: Component<VimUIProps>;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface WebGLRendererProps {
|
|
2
|
+
chars: Uint8Array;
|
|
3
|
+
fgs: Uint8Array;
|
|
4
|
+
bgs: Uint8Array;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
cursorX: number;
|
|
8
|
+
cursorY: number;
|
|
9
|
+
crtEnabled?: boolean;
|
|
10
|
+
showKeyboard?: boolean;
|
|
11
|
+
onMeasure?: (size: {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const WebGLRenderer: (props: WebGLRendererProps & {
|
|
17
|
+
canvasRef?: (el: HTMLCanvasElement) => void;
|
|
18
|
+
}) => import("solid-js").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VimEngine } from './vim-engine';
|
|
2
|
+
export { default as VimEditor } from './VimEditor';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './vim-engine';
|
|
5
|
+
export * from './plugin-manager';
|
|
6
|
+
export interface InitOptions {
|
|
7
|
+
wasmUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function initNetVim(container: HTMLElement, options?: InitOptions): Promise<{
|
|
10
|
+
vim: VimEngine;
|
|
11
|
+
dispose: () => void;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple utility to interact with the Origin Private File System (OPFS)
|
|
3
|
+
*/
|
|
4
|
+
export declare const PRELUDE_BASE = ".config/net-vim/prelude";
|
|
5
|
+
export declare const opfsFS: {
|
|
6
|
+
readFile: typeof getConfigFile;
|
|
7
|
+
writeFile: typeof writeConfigFile;
|
|
8
|
+
listDirectory: typeof listDirectory;
|
|
9
|
+
isDirectory: typeof isDirectory;
|
|
10
|
+
};
|
|
11
|
+
export declare function getConfigFile(path: string): Promise<string | null>;
|
|
12
|
+
export declare function ensureConfigDir(path: string): Promise<FileSystemDirectoryHandle>;
|
|
13
|
+
export declare function writeConfigFile(path: string, content: string): Promise<void>;
|
|
14
|
+
export declare function listDirectory(path: string): Promise<string[]>;
|
|
15
|
+
export declare function isDirectory(path: string): Promise<boolean>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { VimAPI } from './types';
|
|
2
|
+
import { h } from './solid-universal-tui';
|
|
3
|
+
export interface ScopedVimAPI extends VimAPI {
|
|
4
|
+
storage: {
|
|
5
|
+
get: (key: string) => any;
|
|
6
|
+
set: (key: string, value: any) => void;
|
|
7
|
+
};
|
|
8
|
+
log: (...args: any[]) => void;
|
|
9
|
+
fs: {
|
|
10
|
+
readFile: (path: string) => Promise<string | null>;
|
|
11
|
+
writeFile: (path: string, content: string) => Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
configFs: {
|
|
14
|
+
readFile: (path: string) => Promise<string | null>;
|
|
15
|
+
writeFile: (path: string, content: string) => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
h: typeof h;
|
|
18
|
+
babel: any;
|
|
19
|
+
}
|
|
20
|
+
export interface PluginMetadata {
|
|
21
|
+
name: string;
|
|
22
|
+
author?: string;
|
|
23
|
+
version?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface WebVimPlugin {
|
|
27
|
+
metadata: PluginMetadata;
|
|
28
|
+
setup: (api: ScopedVimAPI) => void | Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export declare class PluginManager {
|
|
31
|
+
private plugins;
|
|
32
|
+
private pluginStates;
|
|
33
|
+
private getBaseAPI;
|
|
34
|
+
constructor(getBaseAPI: () => VimAPI);
|
|
35
|
+
/**
|
|
36
|
+
* Loads a TypeScript plugin from a raw string
|
|
37
|
+
*/
|
|
38
|
+
loadPluginFromSource(name: string, tsSource: string): Promise<boolean>;
|
|
39
|
+
private registerPlugin;
|
|
40
|
+
private createScopedAPI;
|
|
41
|
+
getLoadedPlugins(): PluginMetadata[];
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PRELUDE_PLUGINS: Record<string, string>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { JSX as SolidJSX } from 'solid-js';
|
|
2
|
+
export interface TuiElement {
|
|
3
|
+
type: 'Box' | 'Text';
|
|
4
|
+
props: any;
|
|
5
|
+
children: TuiElement[];
|
|
6
|
+
}
|
|
7
|
+
export declare const Fragment: (props: any) => any;
|
|
8
|
+
export declare const render: (code: () => any, node: any) => () => void, effect: <T>(fn: (prev?: T) => T, init?: T) => void, memo: <T>(fn: () => T, equal: boolean) => () => T, createComponent: <T>(Comp: (props: T) => any, props: T) => any, createElement: (tag: string) => any, createTextNode: (value: string) => any, insertNode: (parent: any, node: any, anchor?: any) => void, insert: <T>(parent: any, accessor: T | (() => T), marker?: any | null, initial?: any) => any, spread: <T>(node: any, accessor: (() => T) | T, skipChildren?: boolean) => void, setProp: <T>(node: any, name: string, value: T, prev?: T | undefined) => T, mergeProps: (...sources: unknown[]) => unknown;
|
|
9
|
+
export declare function h(tag: any, props: any, ...children: any[]): any;
|
|
10
|
+
export declare namespace JSX {
|
|
11
|
+
type Element = SolidJSX.Element;
|
|
12
|
+
type ArrayElement = SolidJSX.ArrayElement;
|
|
13
|
+
type FunctionElement = SolidJSX.FunctionElement;
|
|
14
|
+
interface IntrinsicElements {
|
|
15
|
+
'tui-box': any;
|
|
16
|
+
'tui-text': any;
|
|
17
|
+
box: any;
|
|
18
|
+
text: any;
|
|
19
|
+
}
|
|
20
|
+
type ElementClass = SolidJSX.ElementClass;
|
|
21
|
+
type ElementAttributesProperty = SolidJSX.ElementAttributesProperty;
|
|
22
|
+
type ElementChildrenAttribute = SolidJSX.ElementChildrenAttribute;
|
|
23
|
+
type IntrinsicAttributes = SolidJSX.IntrinsicAttributes;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index.ts';
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
declare module "solid-js" {
|
|
2
|
+
namespace JSX {
|
|
3
|
+
interface IntrinsicElements {
|
|
4
|
+
'tui-box': any;
|
|
5
|
+
'tui-text': any;
|
|
6
|
+
'text': any;
|
|
7
|
+
'box': any;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare const TYPES_VERSION = "1.0.0";
|
|
12
|
+
export type VimMode = 'Normal' | 'Insert' | 'Command' | 'Visual';
|
|
13
|
+
export type VimEvent = 'ModeChanged' | 'CursorMoved' | 'TextChanged' | 'BufferLoaded' | 'FileChanged' | 'FileDeleted' | 'KeyDown' | 'FSChanged';
|
|
14
|
+
export interface CompletionItem {
|
|
15
|
+
label: string;
|
|
16
|
+
kind?: string;
|
|
17
|
+
detail?: string;
|
|
18
|
+
documentation?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ContextMenuItem {
|
|
21
|
+
label: string;
|
|
22
|
+
action: () => void;
|
|
23
|
+
priority?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface GutterOptions {
|
|
26
|
+
name: string;
|
|
27
|
+
width: number;
|
|
28
|
+
priority?: number;
|
|
29
|
+
/**
|
|
30
|
+
* A function that returns a TUI element for a given line.
|
|
31
|
+
* Plugins can use the provided 'h' function to create elements.
|
|
32
|
+
*/
|
|
33
|
+
render: (props: {
|
|
34
|
+
lineIndex: number | (() => number);
|
|
35
|
+
lineContent: string | (() => string);
|
|
36
|
+
isCursorLine: boolean | (() => boolean);
|
|
37
|
+
}) => any;
|
|
38
|
+
}
|
|
39
|
+
export interface LineRendererOptions {
|
|
40
|
+
name: string;
|
|
41
|
+
priority?: number;
|
|
42
|
+
render: (props: {
|
|
43
|
+
lineIndex: number | (() => number);
|
|
44
|
+
lineContent: string | (() => string);
|
|
45
|
+
isCursorLine: boolean | (() => boolean);
|
|
46
|
+
gutterWidth: number | (() => number);
|
|
47
|
+
leftCol: number | (() => number);
|
|
48
|
+
viewportWidth: number | (() => number);
|
|
49
|
+
visualStart?: {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
} | null | (() => {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
} | null);
|
|
56
|
+
mode?: VimMode | (() => VimMode);
|
|
57
|
+
cursor?: {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
} | (() => {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
});
|
|
64
|
+
}) => any;
|
|
65
|
+
}
|
|
66
|
+
export interface VimState {
|
|
67
|
+
buffer: string[];
|
|
68
|
+
cursor: {
|
|
69
|
+
x: number;
|
|
70
|
+
y: number;
|
|
71
|
+
};
|
|
72
|
+
visualStart: {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
} | null;
|
|
76
|
+
topLine: number;
|
|
77
|
+
leftCol: number;
|
|
78
|
+
viewportHeight: number;
|
|
79
|
+
viewportWidth: number;
|
|
80
|
+
mode: VimMode;
|
|
81
|
+
commandText: string;
|
|
82
|
+
commandCursorX: number;
|
|
83
|
+
currentFilePath: string | null;
|
|
84
|
+
isExplorer: boolean;
|
|
85
|
+
explorerPath: string;
|
|
86
|
+
isReadOnly: boolean;
|
|
87
|
+
plugins: any[];
|
|
88
|
+
gutters: GutterOptions[];
|
|
89
|
+
lineRenderers: LineRendererOptions[];
|
|
90
|
+
contextMenuItems: ContextMenuItem[];
|
|
91
|
+
completionItems: CompletionItem[];
|
|
92
|
+
selectedCompletionIndex: number;
|
|
93
|
+
hoverText: string | null;
|
|
94
|
+
hoverPos: {
|
|
95
|
+
x: number;
|
|
96
|
+
y: number;
|
|
97
|
+
};
|
|
98
|
+
statusMessage: string | null;
|
|
99
|
+
wrap: boolean;
|
|
100
|
+
}
|
|
101
|
+
export interface FileSystem {
|
|
102
|
+
readFile: (path: string) => Promise<string | null>;
|
|
103
|
+
writeFile: (path: string, content: string) => Promise<void>;
|
|
104
|
+
listDirectory: (path: string) => Promise<string[]>;
|
|
105
|
+
isDirectory: (path: string) => Promise<boolean>;
|
|
106
|
+
}
|
|
107
|
+
export interface VimAPI {
|
|
108
|
+
registerCommand: (name: string, callback: (args: string[]) => void) => void;
|
|
109
|
+
getBuffer: () => string[];
|
|
110
|
+
setBuffer: (buffer: string[]) => void;
|
|
111
|
+
getCursor: () => {
|
|
112
|
+
x: number;
|
|
113
|
+
y: number;
|
|
114
|
+
};
|
|
115
|
+
setCursor: (x: number, y: number) => void;
|
|
116
|
+
getVisualStart: () => {
|
|
117
|
+
x: number;
|
|
118
|
+
y: number;
|
|
119
|
+
} | null;
|
|
120
|
+
getMode: () => VimMode;
|
|
121
|
+
on: (event: VimEvent, callback: (...args: any[]) => void) => void;
|
|
122
|
+
executeCommand: (cmd: string) => void;
|
|
123
|
+
loadPluginFromSource: (name: string, source: string) => Promise<boolean>;
|
|
124
|
+
registerGutter: (options: GutterOptions) => void;
|
|
125
|
+
registerLineRenderer: (options: LineRendererOptions) => void;
|
|
126
|
+
showCompletions: (items: CompletionItem[], onSelect: (item: CompletionItem) => void) => void;
|
|
127
|
+
hideCompletions: () => void;
|
|
128
|
+
showHover: (text: string, x: number, y: number) => void;
|
|
129
|
+
hideHover: () => void;
|
|
130
|
+
registerContextMenuItem: (item: ContextMenuItem) => void;
|
|
131
|
+
insertText: (text: string) => void;
|
|
132
|
+
rerender: () => void;
|
|
133
|
+
setFS: (fs: FileSystem) => void;
|
|
134
|
+
getFS: () => FileSystem;
|
|
135
|
+
resetFS: () => void;
|
|
136
|
+
babel: any;
|
|
137
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { VimAPI, VimState } from './types';
|
|
2
|
+
export declare class VimEngine {
|
|
3
|
+
private buffer;
|
|
4
|
+
private cursor;
|
|
5
|
+
private visualStart;
|
|
6
|
+
private topLine;
|
|
7
|
+
private leftCol;
|
|
8
|
+
private viewportHeight;
|
|
9
|
+
private viewportWidth;
|
|
10
|
+
private mode;
|
|
11
|
+
private commandText;
|
|
12
|
+
private commandCursorX;
|
|
13
|
+
private currentFilePath;
|
|
14
|
+
private isExplorer;
|
|
15
|
+
private explorerPath;
|
|
16
|
+
private isReadOnly;
|
|
17
|
+
private gutters;
|
|
18
|
+
private lineRenderers;
|
|
19
|
+
private contextMenuItems;
|
|
20
|
+
private commands;
|
|
21
|
+
private onUpdate;
|
|
22
|
+
private eventListeners;
|
|
23
|
+
private pluginManager;
|
|
24
|
+
private fs;
|
|
25
|
+
private leader;
|
|
26
|
+
private pendingSequence;
|
|
27
|
+
private isInitialized;
|
|
28
|
+
private completionItems;
|
|
29
|
+
private selectedCompletionIndex;
|
|
30
|
+
private onCompletionSelect;
|
|
31
|
+
private hoverText;
|
|
32
|
+
private hoverPos;
|
|
33
|
+
private statusMessage;
|
|
34
|
+
private messageTimeout;
|
|
35
|
+
private wrap;
|
|
36
|
+
constructor(onUpdate: () => void);
|
|
37
|
+
init(): Promise<void>;
|
|
38
|
+
setUpdateCallback(onUpdate: () => void): void;
|
|
39
|
+
private registerBuiltinCommands;
|
|
40
|
+
private openDirectory;
|
|
41
|
+
private openFile;
|
|
42
|
+
getAPI(): VimAPI;
|
|
43
|
+
hideCompletions(): void;
|
|
44
|
+
setViewportHeight(height: number): void;
|
|
45
|
+
setViewportWidth(width: number): void;
|
|
46
|
+
private scrollCursorIntoView;
|
|
47
|
+
private trigger;
|
|
48
|
+
loadPluginFromSource(name: string, tsSource: string): Promise<boolean>;
|
|
49
|
+
setCursor(x: number, y: number): void;
|
|
50
|
+
getState(): VimState;
|
|
51
|
+
private showMessage;
|
|
52
|
+
handleKey(key: string, _ctrl?: boolean): void;
|
|
53
|
+
private handleExplorerSelect;
|
|
54
|
+
private moveCursor;
|
|
55
|
+
private handleNormalMode;
|
|
56
|
+
private handleInsertMode;
|
|
57
|
+
private handleVisualMode;
|
|
58
|
+
private yankToClipboard;
|
|
59
|
+
private getSelectionText;
|
|
60
|
+
private deleteSelection;
|
|
61
|
+
private handleCommandMode;
|
|
62
|
+
private executeCommand;
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export function init_panic_hook(): void;
|
|
4
|
+
export class Engine {
|
|
5
|
+
free(): void;
|
|
6
|
+
constructor(width: number, height: number);
|
|
7
|
+
render(root: any): any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
11
|
+
|
|
12
|
+
export interface InitOutput {
|
|
13
|
+
readonly memory: WebAssembly.Memory;
|
|
14
|
+
readonly __wbg_engine_free: (a: number, b: number) => void;
|
|
15
|
+
readonly engine_new: (a: number, b: number) => number;
|
|
16
|
+
readonly engine_render: (a: number, b: any) => any;
|
|
17
|
+
readonly init_panic_hook: () => void;
|
|
18
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
19
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
20
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
21
|
+
readonly __externref_table_alloc: () => number;
|
|
22
|
+
readonly __wbindgen_export_4: WebAssembly.Table;
|
|
23
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
24
|
+
readonly __wbindgen_start: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
28
|
+
/**
|
|
29
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
30
|
+
* a precompiled `WebAssembly.Module`.
|
|
31
|
+
*
|
|
32
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
33
|
+
*
|
|
34
|
+
* @returns {InitOutput}
|
|
35
|
+
*/
|
|
36
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
40
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
41
|
+
*
|
|
42
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
43
|
+
*
|
|
44
|
+
* @returns {Promise<InitOutput>}
|
|
45
|
+
*/
|
|
46
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@net-vim/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Vim-compatible editor engine and component library for the web.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -47,15 +47,17 @@
|
|
|
47
47
|
"scripts": {
|
|
48
48
|
"sync-wasm": "cp -r ../../crates/tui-engine/pkg/* ./src/wasm/",
|
|
49
49
|
"build": "npm run sync-wasm && vite build",
|
|
50
|
-
"prepublishOnly": "npm run build"
|
|
50
|
+
"prepublishOnly": "npm run build",
|
|
51
|
+
"test": "vitest run"
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"
|
|
54
|
-
"
|
|
54
|
+
"@net-vim/virtual-keyboard": "workspace:*",
|
|
55
|
+
"solid-js": "^1.9.11"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"typescript": "~5.9.3",
|
|
58
59
|
"vite": "^7.3.1",
|
|
60
|
+
"vite-plugin-dts": "^4.5.4",
|
|
59
61
|
"vite-plugin-solid": "^2.11.10",
|
|
60
62
|
"vite-plugin-top-level-await": "^1.6.0",
|
|
61
63
|
"vite-plugin-wasm": "^3.5.0"
|