diff --git a/packages/napcat-types/external-shims.d.ts b/packages/napcat-types/external-shims.d.ts index 6348f911..abb75cc8 100644 --- a/packages/napcat-types/external-shims.d.ts +++ b/packages/napcat-types/external-shims.d.ts @@ -75,38 +75,6 @@ declare module 'async-mutex' { export default _async_mutex_default; } -declare module '@sinclair/typebox' { - export const Type: { - Object: (...args: any[]) => any; - String: (...args: any[]) => any; - Number: (...args: any[]) => any; - Boolean: (...args: any[]) => any; - Array: (...args: any[]) => any; - Union: (...args: any[]) => any; - Literal: (...args: any[]) => any; - Optional: (...args: any[]) => any; - Record: (...args: any[]) => any; - Any: (...args: any[]) => any; - } & any; - - // Make Static<> actually resolve to a structural type so optional properties work. - export type Static = T extends { static: infer S; } ? S : any; - - export interface TSchema { static?: any; } - export interface TObject extends TSchema { } - export interface TOptional extends TSchema { } - export interface TNumber extends TSchema { } - export interface TString extends TSchema { } - export interface TBoolean extends TSchema { } - export interface TArray extends TSchema { } - export interface TUnion extends TSchema { } - export interface TLiteral extends TSchema { } - export interface TAny extends TSchema { } - export interface TNull extends TSchema { } - export interface TUndefined extends TSchema { } - export interface TVoid extends TSchema { } -} - declare module 'napcat-protobuf' { export class NapProtoMsg { constructor (schema: any); diff --git a/packages/napcat-types/package.json b/packages/napcat-types/package.json index 166ea7f3..ad5aa3fb 100644 --- a/packages/napcat-types/package.json +++ b/packages/napcat-types/package.json @@ -20,7 +20,8 @@ "@types/multer": "^1.4.12", "@types/winston": "^2.4.4", "@types/yaml": "^1.9.7", - "@types/ip": "^1.1.3" + "@types/ip": "^1.1.3", + "@sinclair/typebox": "^0.34.38" }, "devDependencies": { "napcat-core": "workspace:*", diff --git a/packages/napcat-types/package.public.json b/packages/napcat-types/package.public.json index 73ecb86f..0fcf3674 100644 --- a/packages/napcat-types/package.public.json +++ b/packages/napcat-types/package.public.json @@ -1,6 +1,6 @@ { "name": "napcat-types", - "version": "0.0.3", + "version": "0.0.4", "private": false, "type": "module", "types": "./napcat-types/index.d.ts", @@ -15,7 +15,8 @@ "@types/multer": "^1.4.12", "@types/winston": "^2.4.4", "@types/yaml": "^1.9.7", - "@types/ip": "^1.1.3" + "@types/ip": "^1.1.3", + "@sinclair/typebox": "^0.34.38" }, "publishConfig": { "registry": "https://registry.npmjs.org/",