tsbuffer-schema
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "tsbuffer-schema", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "TSBuffer schema declarations", | ||
@@ -8,2 +8,3 @@ "main": "index.js", | ||
"scripts": { | ||
"bp": "tsc --noEmit && npm run build && cd dist && npm version patch && npm publish && cd ..", | ||
"build": "rm -rf dist && tsc -d && cp package.json README.md LICENSE dist/" | ||
@@ -10,0 +11,0 @@ }, |
@@ -5,3 +5,3 @@ import BaseSchema from '../BaseSchema'; | ||
type: 'Array'; | ||
itemType: TSBufferSchema; | ||
elementType: TSBufferSchema; | ||
} |
import BaseSchema from '../BaseSchema'; | ||
export default interface EnumTypeSchema extends BaseSchema { | ||
type: 'Enum'; | ||
values: { | ||
members: { | ||
/** 序列化用 */ | ||
@@ -6,0 +6,0 @@ id: number; |
import BaseSchema from '../BaseSchema'; | ||
import ReferenceTypeSchema from './ReferenceTypeSchema'; | ||
import LiteralTypeSchema from './LiteralTypeSchema'; | ||
import UnionTypeSchema from './UnionTypeSchema'; | ||
import TSBufferSchema from '../TSBufferSchema'; | ||
/** | ||
* Reference like XXX['XX'] | ||
* Reference like XXX['XX']['XX'] | ||
* 注意 A['b' | 'c']不是IndexedAccessType,它们应该作为一个 UnionType被识别 | ||
* 应该等价于 A['b'] | A['c'] | ||
*/ | ||
export default interface IndexedAccessTypeSchema extends BaseSchema { | ||
type: 'IndexedAccess'; | ||
objectType: ReferenceTypeSchema; | ||
index: LiteralTypeSchema | UnionTypeSchema; | ||
objectType: TSBufferSchema; | ||
index: string; | ||
} |
@@ -7,6 +7,8 @@ import BaseSchema from '../BaseSchema'; | ||
/** 继承自哪个interface */ | ||
extends?: ReferenceTypeSchema; | ||
fields: { | ||
extends?: ReferenceTypeSchema[]; | ||
properties?: { | ||
id: number; | ||
name: string; | ||
/** 可选字段 */ | ||
optional?: boolean; | ||
type: TSBufferSchema; | ||
@@ -19,3 +21,6 @@ }[]; | ||
*/ | ||
indexSignature?: TSBufferSchema; | ||
indexSignature?: { | ||
keyType: 'String' | 'Number'; | ||
type: TSBufferSchema; | ||
}; | ||
} |
@@ -7,3 +7,3 @@ import BaseSchema from '../BaseSchema'; | ||
type: 'Literal'; | ||
value: string | number | boolean | null | undefined; | ||
literal?: string | number | boolean | null | undefined; | ||
} |
@@ -20,3 +20,3 @@ import BaseSchema from '../BaseSchema'; | ||
*/ | ||
importPath?: string; | ||
path?: string; | ||
/** | ||
@@ -23,0 +23,0 @@ * name of target type |
@@ -5,7 +5,3 @@ import BaseSchema from '../BaseSchema'; | ||
type: 'Tuple'; | ||
valueTypes: { | ||
/** 编码标识 */ | ||
id: number; | ||
type: TSBufferSchema; | ||
}[]; | ||
elementTypes: TSBufferSchema[]; | ||
} |
@@ -10,3 +10,3 @@ import BooleanTypeSchema from "./schemas/BooleanTypeSchema"; | ||
import NonPrimitiveTypeSchema from "./schemas/NonPrimitiveTypeSchema"; | ||
import ArrayBufferTypeSchema from "./schemas/ArrayBufferTypeSchema"; | ||
import ArrayBufferTypeSchema from "./schemas/BufferTypeSchema"; | ||
import IndexedAccessTypeSchema from "./schemas/IndexedAccessTypeSchema"; | ||
@@ -13,0 +13,0 @@ import ReferenceTypeSchema from "./schemas/ReferenceTypeSchema"; |
@@ -12,3 +12,3 @@ declare const TSBufferTypeId: { | ||
Interface: number; | ||
ArrayBuffer: number; | ||
Buffer: number; | ||
IndexedAccess: number; | ||
@@ -15,0 +15,0 @@ Reference: number; |
@@ -15,3 +15,3 @@ "use strict"; | ||
Interface: 10, | ||
ArrayBuffer: 11, | ||
Buffer: 11, | ||
IndexedAccess: 12, | ||
@@ -18,0 +18,0 @@ Reference: 13, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24091
327