Schema.ts (633B)
1 export type SchemaType = any; 2 3 export type SchemaNames = { 4 blockName?: string; 5 optional?: boolean; 6 }; 7 8 export interface SchemaCompatible { 9 /** 10 * Converts parsed ASN.1 object into current class 11 * @param schema 12 */ 13 fromSchema(schema: SchemaType): void; 14 /** 15 * Convert current object to asn1js object and set correct values 16 * @returns asn1js object 17 */ 18 toSchema(): SchemaType; 19 toJSON(): any; 20 } 21 22 export interface SchemaConstructor { 23 schema?: SchemaType; 24 } 25 26 /** 27 * Parameters for schema generation 28 */ 29 export interface SchemaParameters<N extends Record<string, any> = object> { 30 names?: SchemaNames & N; 31 }