Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): inferred type references inaccessible 'unique symbol' type #16933

Open
wants to merge 1 commit into
base: v6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/model.d.ts
Expand Up @@ -3336,9 +3336,9 @@ export type NonAttribute<T> =
/**
* Dummy Symbol used as branding by {@link ForeignKey}.
*
* Do not export, Do not use.
* Do not use.
*/
declare const ForeignKeyBrand: unique symbol;
export declare const ForeignKeyBrand: unique symbol;

/**
* This is a Branded Type.
Expand Down
13 changes: 13 additions & 0 deletions test/types/model.ts
Expand Up @@ -328,3 +328,16 @@ expectTypeOf(resultDerived).toEqualTypeOf<FilmNoNameToJson>()

const resultOverrideToJson = filmOverrideToJson.toJSON();
expectTypeOf(resultOverrideToJson).toEqualTypeOf<FilmNoNameToJson>();

/**
* Tests for export Model from function
* https://github.com/sequelize/sequelize/issues/15898
*/
export function createTestModel() {
class TestModel extends Model {
declare id: string;
};
return TestModel;
}
export type TStatic = ReturnType<typeof createTestModel>;
export type TInstance = InstanceType<TStatic>;