Skip to content

Commit

Permalink
fix: typing SaveData
Browse files Browse the repository at this point in the history
  • Loading branch information
m2a2x committed Nov 4, 2024
1 parent 07323f8 commit 9c56539
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
7 changes: 3 additions & 4 deletions lib/editor.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import {
ComponentPublicInstance,
DefineComponent,
} from 'vue';
import {
import type {
EditCell,
ColumnDataSchemaModel,
HyperFunc,
VNode,
EditorBase,
SaveData,
} from '@revolist/revogrid';
import { VueTemplateConstructor } from './renderer';

Expand All @@ -18,7 +17,7 @@ import { VueTemplateConstructor } from './renderer';
*/
export type EditorType = {
column: ColumnDataSchemaModel;
save: (value: SaveData, preventFocus?: boolean) => void;
save: (value: any, preventFocus?: boolean) => void;
close: (focusNext?: boolean) => void;
} & Partial<EditCell>;

Expand All @@ -30,7 +29,7 @@ export class VueEditorAdapter implements EditorBase {
constructor(
private VueEditorConstructor: DefineComponent,
public column: ColumnDataSchemaModel,
private save: (value: SaveData, preventFocus?: boolean) => void,
private save: (value: any, preventFocus?: boolean) => void,
private close: (focusNext?: boolean) => void,
private vInstance: ComponentInternalInstance | null,
) {}
Expand Down
4 changes: 2 additions & 2 deletions lib/editor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ColumnDataSchemaModel, EditorCtr, SaveData } from '@revolist/revogrid';
import type { ColumnDataSchemaModel, EditorCtr } from '@revolist/revogrid';
import { getCurrentInstance } from 'vue';
import { VueEditorAdapter } from './editor.adapter';

Expand All @@ -18,7 +18,7 @@ export const Editor = (vueConstructor: any): EditorCtr => {
const instance = getCurrentInstance();
return function (
column: ColumnDataSchemaModel,
save: (value: SaveData, preventFocus?: boolean) => void,
save: (value: any, preventFocus?: boolean) => void,
close: (focusNext?: boolean) => void,
) {
return new VueEditorAdapter(
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9c56539

Please sign in to comment.