Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types: improve napi binding typing using generated types #69680

Merged
merged 7 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move all binding types to separate file
  • Loading branch information
ForsakenHarmony committed Sep 20, 2024
commit 31263297455434b4c9d5f77382a2f886a6d5385c
4 changes: 2 additions & 2 deletions crates/napi/src/next_api/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ async fn benchmark_file_io(directory: Vc<FileSystemPath>) -> Result<Vc<Completio
Ok(Completion::new())
}

#[napi(ts_return_type = "{ __napiType: \"Project\" }")]
#[napi]
pub async fn project_update(
#[napi(ts_arg_type = "{ __napiType: \"Project\" }")] project: External<ProjectInstance>,
options: NapiPartialProjectOptions,
Expand All @@ -439,7 +439,7 @@ pub async fn project_update(
Ok(())
}

#[napi(ts_return_type = "{ __napiType: \"Project\" }")]
#[napi]
pub async fn project_shutdown(
#[napi(ts_arg_type = "{ __napiType: \"Project\" }")] project: External<ProjectInstance>,
) {
Expand Down
5 changes: 4 additions & 1 deletion packages/next/src/build/swc/generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ export function projectNew(
export function projectUpdate(
project: { __napiType: 'Project' },
options: NapiPartialProjectOptions
): { __napiType: 'Project' }
): Promise<void>
export function projectShutdown(project: {
__napiType: 'Project'
}): Promise<void>
export interface AppPageNapiRoute {
/** The relative path from project_path to the route file */
originalName?: string
Expand Down
Loading