mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-04 06:31:13 +00:00
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:
parent
613690f5af
commit
2998e04435
32
packages/napcat-types/external-shims.d.ts
vendored
32
packages/napcat-types/external-shims.d.ts
vendored
@ -75,38 +75,6 @@ declare module 'async-mutex' {
|
|||||||
export default _async_mutex_default;
|
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' {
|
declare module 'napcat-protobuf' {
|
||||||
export class NapProtoMsg<T = any> {
|
export class NapProtoMsg<T = any> {
|
||||||
constructor (schema: any);
|
constructor (schema: any);
|
||||||
|
|||||||
@ -20,7 +20,8 @@
|
|||||||
"@types/multer": "^1.4.12",
|
"@types/multer": "^1.4.12",
|
||||||
"@types/winston": "^2.4.4",
|
"@types/winston": "^2.4.4",
|
||||||
"@types/yaml": "^1.9.7",
|
"@types/yaml": "^1.9.7",
|
||||||
"@types/ip": "^1.1.3"
|
"@types/ip": "^1.1.3",
|
||||||
|
"@sinclair/typebox": "^0.34.38"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"napcat-core": "workspace:*",
|
"napcat-core": "workspace:*",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "napcat-types",
|
"name": "napcat-types",
|
||||||
"version": "0.0.3",
|
"version": "0.0.4",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"types": "./napcat-types/index.d.ts",
|
"types": "./napcat-types/index.d.ts",
|
||||||
@ -15,7 +15,8 @@
|
|||||||
"@types/multer": "^1.4.12",
|
"@types/multer": "^1.4.12",
|
||||||
"@types/winston": "^2.4.4",
|
"@types/winston": "^2.4.4",
|
||||||
"@types/yaml": "^1.9.7",
|
"@types/yaml": "^1.9.7",
|
||||||
"@types/ip": "^1.1.3"
|
"@types/ip": "^1.1.3",
|
||||||
|
"@sinclair/typebox": "^0.34.38"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"registry": "https://registry.npmjs.org/",
|
"registry": "https://registry.npmjs.org/",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user