Skip to content

Commit

Permalink
change MojoModels from type to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
dmanto committed Jan 17, 2025
1 parent bd2865f commit 312a2b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ const customTypescriptConfig = {
}
],

'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/consistent-indexed-object-style': 'off'
}
};

Expand Down
4 changes: 3 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export interface MojoContext extends Context {

export type MojoAction = (ctx: MojoContext, ...args: any[]) => any;

export type MojoModels = Record<string, any>;
export interface MojoModels {
[key: string]: any;
}

export interface MojoTags {
asset: (path: string, attrs?: TagAttrs) => Promise<SafeString>;
Expand Down
6 changes: 5 additions & 1 deletion test/support/ts/full-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import {Bar} from './models/bar.js';
import helpersPlugin from './plugins/helpers.js';
import mojo, {yamlConfigPlugin} from '../../../../../lib/core.js';

declare module '../../../../../lib/core.js' {
interface MojoModels {
bar: Bar;
}
}
export const app = mojo();

app.log.level = 'info';
Expand Down

0 comments on commit 312a2b0

Please sign in to comment.