Files
oxc-project__oxc/napi/transform-react/transform-react.wasi.d.cts
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

340 lines
9.4 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',
}
export interface SourceMap {
file?: string
mappings: string
names: Array<string>
sourceRoot?: string
sources: Array<string>
sourcesContent?: Array<string>
version: number
x_google_ignoreList?: Array<number>
}
/**
* Configure how TSX and JSX are transformed.
*
* @see <https://oxc.rs/docs/guide/usage/transformer/jsx>
*/
export interface JsxOptions {
/**
* Decides which runtime to use.
*
* - 'automatic' - auto-import the correct JSX factories
* - 'classic' - no auto-import
*
* @default 'automatic'
*/
runtime?: 'classic' | 'automatic'
/**
* Emit development-specific information, such as `__source` and `__self`.
*
* @default false
*/
development?: boolean
/**
* Toggles whether or not to throw an error if an XML namespaced tag name
* is used.
*
* Though the JSX spec allows this, it is disabled by default since React's
* JSX does not currently have support for it.
*
* @default true
*/
throwIfNamespace?: boolean
/**
* Mark JSX elements and top-level React method calls as pure for tree shaking.
*
* @default true
*/
pure?: boolean
/**
* Replaces the import source when importing functions.
*
* @default 'react'
*/
importSource?: string
/**
* Replace the function used when compiling JSX expressions. It should be a
* qualified name (e.g. `React.createElement`) or an identifier (e.g.
* `createElement`).
*
* Only used for `classic` {@link runtime}.
*
* @default 'React.createElement'
*/
pragma?: string
/**
* Replace the component used when compiling JSX fragments. It should be a
* valid JSX tag name.
*
* Only used for `classic` {@link runtime}.
*
* @default 'React.Fragment'
*/
pragmaFrag?: string
/**
* Enable React Fast Refresh.
*
* @default false
*/
refresh?: boolean | ReactRefreshOptions
}
/** Dynamic feature-gating import. */
export interface ReactCompilerDynamicGating {
source: string
}
/**
* Partial React Compiler environment configuration.
*
* Unset fields retain compiler defaults. Callback-valued providers and the
* compiler's test-only panic switch are intentionally not exposed.
*/
export interface ReactCompilerEnvironmentOptions {
customMacros?: Array<string>
enableResetCacheOnSourceFileChanges?: boolean
enablePreserveExistingMemoizationGuarantees?: boolean
validatePreserveExistingMemoizationGuarantees?: boolean
/**
* Enable exhaustive manual memo dependency validation.
*
* @default false
*/
validateExhaustiveMemoizationDependencies?: boolean
validateExhaustiveEffectDependencies?: 'off' | 'all' | 'missing-only' | 'extra-only'
enableOptionalDependencies?: boolean
enableNameAnonymousFunctions?: boolean
validateHooksUsage?: boolean
validateRefAccessDuringRender?: boolean
validateNoSetStateInRender?: boolean
enableUseKeyedState?: boolean
validateNoSetStateInEffects?: boolean
validateNoDerivedComputationsInEffects?: boolean
validateNoDerivedComputationsInEffectsExp?: boolean
validateNoJsxInTryStatements?: boolean
validateStaticComponents?: boolean
validateNoCapitalizedCalls?: Array<string>
validateBlocklistedImports?: Array<string>
validateSourceLocations?: boolean
validateNoImpureFunctionsInRender?: boolean
validateNoFreezingKnownMutableFunctions?: boolean
enableAssumeHooksFollowRulesOfReact?: boolean
enableTransitivelyFreezeFunctionExpressions?: boolean
enableFunctionOutlining?: boolean
enableJsxOutlining?: boolean
assertValidMutableRanges?: boolean
enableCustomTypeDefinitionForReanimated?: boolean
enableTreatRefLikeIdentifiersAsRefs?: boolean
enableTreatSetIdentifiersAsStateSetters?: boolean
/**
* Validate that `useMemo` callbacks return a value.
*
* @default false
*/
validateNoVoidUseMemo?: boolean
enableAllowSetStateFromRefsInEffects?: boolean
enableVerboseNoSetStateInEffect?: boolean
enableForest?: boolean
}
/** Static feature-gating import. */
export interface ReactCompilerGating {
source: string
importSpecifierName: string
}
/** Meta-internal React runtime target. */
export interface ReactCompilerMetaTarget {
kind: 'donotuse_meta_internal'
runtimeModule?: string
}
/**
* React Compiler options.
*
* Fields mirror `babel-plugin-react-compiler` and `react-compiler-napi`.
*/
export interface ReactCompilerOptions {
/**
* Which functions the compiler attempts to compile.
*
* @default 'infer'
*/
compilationMode?: 'infer' | 'syntax' | 'annotation' | 'all'
/**
* When compiler diagnostics escalate into a hard failure.
*
* @default 'none'
*/
panicThreshold?: 'none' | 'critical_errors' | 'all_errors'
/**
* React runtime target. React 17 and 18 use `react-compiler-runtime`;
* React 19 uses `react/compiler-runtime`.
*
* @default '19'
*/
target?: '17' | '18' | '19' | ReactCompilerMetaTarget
/** Emit both compiled and original functions behind an imported feature gate. */
gating?: ReactCompilerGating
/** Enable `"use memo if(...)"` directive-driven gating. */
dynamicGating?: ReactCompilerDynamicGating
/**
* Analyze and report diagnostics without applying compiler output.
*
* @deprecated Prefer `outputMode: "lint"`.
* @default false
*/
noEmit?: boolean
/** Select client, SSR, or lint output. */
outputMode?: 'client' | 'ssr' | 'lint'
/**
* ESLint rule names whose suppressions opt a function out of compilation.
* Defaults to `react-hooks/exhaustive-deps` and `react-hooks/rules-of-hooks`;
* pass an empty array to disable this behavior.
*/
eslintSuppressionRules?: Array<string>
/**
* Treat Flow suppression comments as opt-outs.
*
* @default true
*/
flowSuppressions?: boolean
/**
* Compile functions carrying `"use no memo"` or `"use no forget"`.
*
* @default false
*/
ignoreUseNoForget?: boolean
/** Additional directives that opt a function out of compilation. */
customOptOutDirectives?: Array<string>
/**
* Only run the React Compiler when the filename contains one of these strings.
*
* By default, files whose filename contains `node_modules` are skipped.
* Providing this option replaces that default filter.
*
* Function-valued `sources` filters from the Babel plugin are intentionally
* unsupported across the native boundary.
*/
sources?: Array<string>
/** Feature flags and validation settings for compiler passes. */
environment?: ReactCompilerEnvironmentOptions
}
/** React Fast Refresh options. */
export interface ReactRefreshOptions {
/**
* Specify the identifier of the refresh registration variable.
*
* @default `$RefreshReg$`
*/
refreshReg?: string
/**
* Specify the identifier of the refresh signature variable.
*
* @default `$RefreshSig$`
*/
refreshSig?: string
/**
* Emit full hook signatures instead of compact hashes.
*
* @default false
*/
emitFullSignatures?: boolean
}
/**
* Compile a JavaScript or TypeScript React module asynchronously.
*
* This uses a worker-pool thread and can be slower than `transformSync` for a
* single small module.
*/
export declare function transform(filename: string, sourceText: string, options?: TransformOptions | undefined | null): Promise<TransformResult>
/**
* Options for compiling a JavaScript or TypeScript React module.
*
* `lang`, `sourceType`, and `sourcemap` configure the surrounding Oxc
* parse/codegen pipeline. React Compiler and JSX transforms are configured
* independently.
*/
export interface TransformOptions {
/** Treat the source as `js`, `jsx`, `ts`, `tsx`, or `dts`. */
lang?: 'js' | 'jsx' | 'ts' | 'tsx' | 'dts'
/** Treat the source as script, module, CommonJS, or infer it from syntax. */
sourceType?: 'script' | 'module' | 'commonjs' | 'unambiguous'
/**
* Generate a source map.
*
* @default false
*/
sourcemap?: boolean
/**
* Configure how TSX and JSX are transformed, or preserve JSX syntax.
*
* @see <https://oxc.rs/docs/guide/usage/transformer/jsx>
*/
jsx?: 'preserve' | JsxOptions
/**
* Configure React Compiler, or disable it with `false`.
*
* @default true
*/
reactCompiler?: boolean | ReactCompilerOptions
}
/** Result returned by the React Compiler transform. */
export interface TransformResult {
/** Whether the transform was aborted without emitting code. */
fatal: boolean
/**
* Transformed JavaScript code.
*
* This is empty when parsing, semantic analysis, option validation, or the
* React Compiler reports a fatal error.
*/
code: string
/** Source map, populated when `sourcemap` is `true`. */
map?: SourceMap
/** Parse, semantic, downstream transform, and fatal React Compiler diagnostics. */
errors: Array<OxcError>
}
/**
* Compile a JavaScript or TypeScript React module synchronously.
*
* The React Compiler runs first on the pristine AST. TypeScript syntax is
* removed and configured JSX transforms run afterwards.
*/
export declare function transformSync(filename: string, sourceText: string, options?: TransformOptions | undefined | null): TransformResult