Files
oxc-project__oxc/apps/oxlint/src-js/bindings.d.ts
renovate[bot] 59e8d5fb91 chore(deps): update napi (#26533)
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Adoption](https://docs.renovatebot.com/merge-confidence/) |
[Passing](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) | Type |
Update |
|---|---|---|---|---|---|---|---|
| [@napi-rs/cli](https://napi.rs/)
([source](https://redirect.github.com/napi-rs/napi-rs)) | [`3.9.0` →
`3.9.1`](https://renovatebot.com/diffs/npm/@napi-rs%2fcli/3.9.0/3.9.1) |
![age](https://developer.mend.io/api/mc/badges/age/npm/@napi-rs%2fcli/3.9.1?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@napi-rs%2fcli/3.9.1?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@napi-rs%2fcli/3.9.0/3.9.1?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@napi-rs%2fcli/3.9.0/3.9.1?slim=true)
| pnpm.catalog.default | patch |
| [napi](https://redirect.github.com/napi-rs/napi-rs) | `3.12.2` →
`3.12.3` |
![age](https://developer.mend.io/api/mc/badges/age/crate/napi/3.12.3?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/crate/napi/3.12.3?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/crate/napi/3.12.2/3.12.3?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/crate/napi/3.12.2/3.12.3?slim=true)
| workspace.dependencies | patch |
| [napi-derive](https://redirect.github.com/napi-rs/napi-rs) | `3.6.3` →
`3.6.4` |
![age](https://developer.mend.io/api/mc/badges/age/crate/napi-derive/3.6.4?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/crate/napi-derive/3.6.4?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/crate/napi-derive/3.6.3/3.6.4?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/crate/napi-derive/3.6.3/3.6.4?slim=true)
| workspace.dependencies | patch |

---

### Release Notes

<details>
<summary>napi-rs/napi-rs (@&#8203;napi-rs/cli)</summary>

###
[`v3.9.1`](https://redirect.github.com/napi-rs/napi-rs/compare/@napi-rs/cli@3.9.0...@napi-rs/cli@3.9.1)

[Compare
Source](https://redirect.github.com/napi-rs/napi-rs/compare/@napi-rs/cli@3.9.0...@napi-rs/cli@3.9.1)

</details>

---

### Configuration

📅 **Schedule**: (in timezone Asia/Shanghai)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC43MS4wIiwidXBkYXRlZEluVmVyIjoiNDQuNzEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
2026-09-10 14:26:42 +00:00

131 lines
4.8 KiB
TypeScript

/* auto-generated by NAPI-RS */
/* eslint-disable */
export interface Comment {
type: 'Line' | 'Block'
value: string
start: number
end: number
}
export interface ErrorLabel {
message: string | null
start: number
end: number
}
export interface OxcError {
severity: Severity
message: string
labels: Array<ErrorLabel>
helpMessage: string | null
codeframe: string | null
}
export declare const enum Severity {
Error = 'Error',
Warning = 'Warning',
Advice = 'Advice',
}
/**
* Apply fixes to source text and return the fixed code.
*
* - `source_text` is the original source code.
* - `fixes_json` is a JSON string containing `Vec<Vec<JsFix>>` — an array of fix groups,
* one group per diagnostic which provides fixes.
* Each inner array should have length of 1 at minimum.
*
* If source text starts with a BOM, `JSFix`es must have offsets relative to the start
* of the source text *without* the BOM.
*
* Each group's fixes are merged, then all merged fixes are applied to `source_text`.
*
* Fix ranges are converted from UTF-16 code units to UTF-8 bytes.
*/
export declare function applyFixes(sourceText: string, fixesJson: string): string | null
/**
* Get offset within a `Uint8Array` which is aligned on `BLOCK_ALIGN`.
*
* Does not check that the offset is within bounds of `buffer`.
* To ensure it always is, provide a `Uint8Array` of at least `BLOCK_SIZE + BLOCK_ALIGN` bytes.
*/
export declare function getBufferOffset(buffer: Uint8Array): number
/** JS callback to create a workspace. */
export type JsCreateWorkspaceCb = ((arg: string) => Promise<undefined>)
/** JS callback to destroy a workspace. */
export type JsDestroyWorkspaceCb = ((arg: string) => void)
/** JS callback to lint a file. */
export type JsLintFileCb = ((arg0: string, arg1: number, arg2: Uint8Array | undefined | null, arg3: Array<number>, arg4: Array<number>, arg5: string, arg6: string, arg7?: string | undefined | null) => string | null)
/** JS callback to load JavaScript config files. */
export type JsLoadJsConfigsCb = ((arg: Array<string>) => Promise<string>)
/** JS callback to load a JS plugin. */
export type JsLoadPluginCb = ((arg0: string, arg1: string | undefined | null, arg2: boolean, arg3?: string | undefined | null) => Promise<string>)
/** JS callback to setup configs. */
export type JsSetupRuleConfigsCb = ((arg: string) => string | null)
/**
* NAPI entry point.
*
* JS side passes in:
* 1. `args`: Command line arguments (process.argv.slice(2))
* 2. `load_plugin`: Load a JS plugin from a file path.
* 3. `setup_rule_configs`: Setup configuration options.
* 4. `lint_file`: Lint a file.
* 5. `create_workspace`: Create a workspace.
* 6. `destroy_workspace`: Destroy a workspace.
* 7. `load_js_configs`: Load JavaScript config files.
*
* Returns `true` if linting succeeded without errors, `false` otherwise.
*/
export declare function lint(args: Array<string>, loadPlugin: JsLoadPluginCb, setupRuleConfigs: JsSetupRuleConfigsCb, lintFile: JsLintFileCb, createWorkspace: JsCreateWorkspaceCb, destroyWorkspace: JsDestroyWorkspaceCb, loadJsConfigs: JsLoadJsConfigsCb): Promise<boolean>
/**
* Parse AST into provided `Uint8Array` buffer, synchronously.
*
* Source text must be written into somewhere towards end of the buffer.
* - `source_start` is position of first byte of source text in buffer
* - `source_len` is length of source text (in UTF-8 bytes)
*
* This function will parse the source, and write the AST into the buffer, starting at the end (before the source text).
*
* It also writes to the very end of the buffer the offset of `Program` within the buffer.
*
* Caller can deserialize data from the buffer on JS side.
*
* # SAFETY
*
* Caller must ensure:
* * Source text is written into the buffer.
* * Start of source text is at `source_start` bytes from the start of the buffer.
* * Source text's UTF-8 byte length is `source_len`.
* * This section of bytes in the buffer comprises a valid UTF-8 string.
*
* If source text is originally a JS string on JS side, and converted to a buffer with
* `Buffer.from(str)` or `new TextEncoder().encode(str)`, this guarantees it's valid UTF-8.
*
* # Panics
*
* Panics if source text is too long, or AST takes more memory than is available in the buffer.
*/
export declare function parseRawSync(filename: string, buffer: Uint8Array, sourceStart: number, sourceLen: number, options?: ParserOptions | undefined | null): void
export interface ParserOptions {
/** Treat the source text as `js`, `jsx`, `ts`, `tsx` or `dts`. */
lang?: 'js' | 'jsx' | 'ts' | 'tsx' | 'dts'
/** Treat the source text as `script` or `module` code. */
sourceType?: 'script' | 'module' | 'commonjs' | 'unambiguous' | undefined
/** Ignore non-fatal parsing errors */
ignoreNonFatalErrors?: boolean
}
/** Returns `true` if raw transfer is supported on this platform. */
export declare function rawTransferSupported(): boolean