mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 22:48:13 +08:00
Remove usage of 'null' in favor of 'undefined'
This commit is contained in:
@@ -8,12 +8,12 @@ export type WasmEditorInstance = InstanceType<WasmRawInstance["JsEditorHandle"]>
|
||||
export type Editor = Readonly<ReturnType<typeof createEditor>>;
|
||||
|
||||
// `wasmImport` starts uninitialized because its initialization needs to occur asynchronously, and thus needs to occur by manually calling and awaiting `initWasm()`
|
||||
let wasmImport: WasmRawInstance | null = null;
|
||||
let wasmImport: WasmRawInstance | undefined;
|
||||
|
||||
// Should be called asynchronously before `createEditor()`
|
||||
export async function initWasm(): Promise<void> {
|
||||
// Skip if the WASM module is already initialized
|
||||
if (wasmImport !== null) return;
|
||||
if (wasmImport !== undefined) return;
|
||||
|
||||
// Import the WASM module JS bindings and wrap them in the panic proxy
|
||||
wasmImport = await import("@/../wasm/pkg").then(panicProxy);
|
||||
|
||||
@@ -82,9 +82,9 @@ export type HintGroup = HintInfo[];
|
||||
export class HintInfo {
|
||||
readonly keyGroups!: KeysGroup[];
|
||||
|
||||
readonly keyGroupsMac!: KeysGroup[] | null;
|
||||
readonly keyGroupsMac!: KeysGroup[] | undefined;
|
||||
|
||||
readonly mouse!: MouseMotion | null;
|
||||
readonly mouse!: MouseMotion | undefined;
|
||||
|
||||
readonly label!: string;
|
||||
|
||||
@@ -669,7 +669,7 @@ export type WidgetLayout = {
|
||||
|
||||
export function defaultWidgetLayout(): WidgetLayout {
|
||||
return {
|
||||
layoutTarget: null,
|
||||
layoutTarget: undefined,
|
||||
layout: [],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user