Skip to content

Commit

Permalink
🔧 fix: ts type
Browse files Browse the repository at this point in the history
  • Loading branch information
deepkolos committed Jul 14, 2023
1 parent 25a507f commit 39d86aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
10 changes: 4 additions & 6 deletions src/plugins/ReactRenderPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ function install(editor: NodeEditor, { createRoot }: { createRoot?: typeof ICrea
});
}

class ReactRenderPluginClass implements Plugin {
name = 'ReactRenderPlugin';
install = install;
}

export const ReactRenderPlugin = new ReactRenderPluginClass();
export const ReactRenderPlugin: Plugin = {
name: 'ReactRenderPlugin',
install,
};
7 changes: 3 additions & 4 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ export const ValueTypeNameMap: { [k in ValueType]: string } = Object.freeze({
} as const);

export const ValueTypeNameReverseMap: { [k: string]: ValueType } = Object.freeze(
Object.keys(ValueTypeNameMap).reduce((acc, key) => {
// @ts-ignore
(Object.keys(ValueTypeNameMap) as ValueType[]).reduce((acc, key) => {
acc[ValueTypeNameMap[key]] = key;
return acc;
}, {}),
}, {} as { [k: string]: ValueType }),
) as any;

export const ValueTypeSocketMap = Sockets;
Expand Down Expand Up @@ -98,7 +97,7 @@ export const ChannelLenNeedsMap = Object.freeze({
w: 4,
} as const);

export const ValueTypeCtor = Object.freeze({
export const ValueTypeCtor: { [k: string]: () => any } = Object.freeze({
float: () => 0,
vec2: () => [0, 0],
vec3: () => [0, 0, 0],
Expand Down

0 comments on commit 39d86aa

Please sign in to comment.