Skip to content

Commit

Permalink
Merge pull request #128 from bgschiller/fix/emitting-enums
Browse files Browse the repository at this point in the history
  • Loading branch information
oscartbeaumont authored Sep 6, 2024
2 parents 98ac1cd + e602894 commit ea8b314
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/app/src/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ type __EventObj__<T> = {
once: (
cb: TAURI_API_EVENT.EventCallback<T>,
) => ReturnType<typeof TAURI_API_EVENT.once<T>>;
emit: T extends null
emit: null extends T
? (payload?: T) => ReturnType<typeof TAURI_API_EVENT.emit>
: (payload: T) => ReturnType<typeof TAURI_API_EVENT.emit>;
};
Expand Down
2 changes: 1 addition & 1 deletion src/lang/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type __EventObj__<T> = {
once: (
cb: TAURI_API_EVENT.EventCallback<T>,
) => ReturnType<typeof TAURI_API_EVENT.once<T>>;
emit: T extends null
emit: null extends T
? (payload?: T) => ReturnType<typeof TAURI_API_EVENT.emit>
: (payload: T) => ReturnType<typeof TAURI_API_EVENT.emit>;
};
Expand Down

0 comments on commit ea8b314

Please sign in to comment.