first commit

This commit is contained in:
2025-04-24 13:11:28 +08:00
commit ff9c54d5e4
5960 changed files with 834111 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
# Hunspell
The files in this directory are:
* `hunspell.wasm`: [Hunspell](https://github.com/hunspell/hunspell) compiled to WebAssembly using Emscripten, via the [build.sh](../build.sh) script.
* `hunspell.mjs`: a JavaScript wrapper for the WebAssembly module, generated by Emscripten.
* `hunspell.d.ts`: manually-created types for the exports from the JavaScript module.
Note: To speed up compilation on ARM architecture (e.g. Apple M1), add `-arm64` to the Docker image tag in `Dockerfile`.

View File

@@ -0,0 +1,73 @@
/* eslint no-dupe-class-members: 0 */
declare class Hunspell {
cwrap(
method: 'Hunspell_create',
output: string,
input: string[]
): (affPtr: number, dicPtr: number) => number
cwrap(
method: 'Hunspell_destroy',
output: string,
input: string[]
): (spellPtr: number) => number
cwrap(
method: 'Hunspell_spell',
output: string,
input: string[]
): (spellPtr: number, wordPtr: number) => number
cwrap(
method: 'Hunspell_suggest',
output: string,
input: string[]
): (spellPtr: number, suggestionListPtr: number, wordPtr: number) => number
cwrap(
method: 'Hunspell_add_dic',
output: string,
input: string[]
): (spellPtr: number, wordPtr: number) => number
cwrap(
method: 'Hunspell_add',
output: string,
input: string[]
): (spellPtr: number, wordPtr: number) => number
cwrap(
method: 'Hunspell_remove',
output: string,
input: string[]
): (spellPtr: number, wordPtr: number) => number
cwrap(
method: 'Hunspell_free_list',
output: string,
input: string[]
): (spellPtr: number, suggestionListPtr: number, n: number) => number
stringToNewUTF8(input: string): number
UTF8ToString(input: number): string
_malloc(length: number): number
_free(ptr: number): void
getValue(ptr: number, type: string): number
FS: {
mkdir(path: string): void
mount(type: any, opts: Record<string, any>, dir: string): void
writeFile(
path: string,
data: string | ArrayBufferView,
opts?: { flags?: string }
)
}
MEMFS: any
}
declare const factory = async (options?: Record<string, any>) =>
new Hunspell(options)
export default factory

File diff suppressed because it is too large Load Diff