Add @sinclair/typebox as dependency and remove shim

Removed the manual TypeBox type definitions from external-shims.d.ts and added @sinclair/typebox as a dependency in package.json and package.public.json. Bumped package version to 0.0.4 to reflect this change.
This commit is contained in:
手瓜一十雪 2026-01-27 21:24:50 +08:00
parent 613690f5af
commit 2998e04435
3 changed files with 5 additions and 35 deletions

View File

@ -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> = T extends { static: infer S; } ? S : any;
export interface TSchema { static?: any; }
export interface TObject<T = any> extends TSchema { }
export interface TOptional<T = any> extends TSchema { }
export interface TNumber extends TSchema { }
export interface TString extends TSchema { }
export interface TBoolean extends TSchema { }
export interface TArray<T = any> extends TSchema { }
export interface TUnion<T = any> extends TSchema { }
export interface TLiteral<T = any> 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<T = any> {
constructor (schema: any);

View File

@ -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:*",

View File

@ -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/",