Skip to content

Commit

Permalink
feat: allow 'Methods' unknown type.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardo2016 committed Oct 26, 2023
1 parent f3aae8e commit 40e6cfa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Typo/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ export namespace FibApp {

export interface FibAppORMModel<
PropertyTypes extends Record<string, FxOrmInstance.FieldRuntimeType> = Record<string, FxOrmInstance.FieldRuntimeType>,
Methods extends Record<string, (...args: any) => any> = Record<string, (...args: any) => any>
> extends FxOrmModel.Model<PropertyTypes, Methods> {
Methods extends Record<string, (...args: any) => any> | unknown = Record<string, (...args: any) => any>
> extends FxOrmModel.Model<PropertyTypes, Methods extends unknown ? any : Methods> {
$webx: {
// globally unique class id
readonly cid: number
Expand Down
4 changes: 2 additions & 2 deletions typings/Typo/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export declare namespace FibApp {
};
};
};
interface FibAppORMModel<PropertyTypes extends Record<string, FxOrmInstance.FieldRuntimeType> = Record<string, FxOrmInstance.FieldRuntimeType>, Methods extends Record<string, (...args: any) => any> = Record<string, (...args: any) => any>> extends FxOrmModel.Model<PropertyTypes, Methods> {
interface FibAppORMModel<PropertyTypes extends Record<string, FxOrmInstance.FieldRuntimeType> = Record<string, FxOrmInstance.FieldRuntimeType>, Methods extends Record<string, (...args: any) => any> | unknown = Record<string, (...args: any) => any>> extends FxOrmModel.Model<PropertyTypes, Methods extends unknown ? any : Methods> {
$webx: {
readonly cid: number;
readonly model_name: string;
Expand Down Expand Up @@ -311,7 +311,7 @@ export declare namespace FibApp {
app: FibAppClass;
models: GlobalAppModels;
graphql<T = any>(query: FibApp.GraphQLQueryString, req: FibApp.FibAppHttpRequest): T;
define: <T extends Record<string, FxOrmModel.ComplexModelPropertyDefinition>, U extends FibAppOrmModelDefOptions<FxOrmModel.GetPropertiesType<T>>>(name: string, properties: T, opts?: U) => FibAppORMModel<FxOrmModel.GetPropertiesType<T>, Exclude<U['methods'], void>>;
define: <T extends Record<string, FxOrmModel.ComplexModelPropertyDefinition>, U extends FibAppOrmModelDefOptions<FxOrmModel.GetPropertiesType<T>>>(name: string, properties: T, opts?: U) => FibAppORMModel<FxOrmModel.GetPropertiesType<T>, Exclude<U['methods'], void> & Record<string, (...args: any) => any>>;
}
export type FibAppDb = FibAppORM;
export type FibAppFunctionToBeFilter = (FibAppFilterableApiFunction__WithModel | FibAppFilterableApiFunction__NullModel | FibAppOrmModelFunction | FibAppInternalApiFunction);
Expand Down

0 comments on commit 40e6cfa

Please sign in to comment.