asn1tools-js
Version:
ASN.1 encoding and decoding library for TypeScript/JavaScript, compatible with Python asn1tools
48 lines • 1.32 kB
TypeScript
/**
* ASN.1 compiler - converts parsed types into executable type objects
*/
import { Asn1Specification, ParsedModule } from './types';
export declare class Asn1Compiler {
private modules;
private globalTypes;
private resolving;
compile(parsedModules: ParsedModule[]): Asn1Specification;
private compileType;
private compileTypeInternal;
private compileIntegerType;
private compileOctetStringType;
private compileEnumeratedType;
private compileSequenceType;
private compileSequenceOfType;
private compileChoiceType;
private resolveDefinedType;
}
/**
* Specification class that provides the main API
*/
export declare class Specification {
private modules;
private types;
constructor(specification: Asn1Specification);
/**
* Encode a value using the specified type
*/
encode(typeName: string, value: any): Uint8Array;
/**
* Decode data using the specified type
*/
decode(typeName: string, data: Uint8Array): any;
/**
* Get available type names
*/
getTypeNames(): string[];
/**
* Get available module names
*/
getModuleNames(): string[];
/**
* Get types from a specific module
*/
getModuleTypes(moduleName: string): string[];
}
//# sourceMappingURL=compiler.d.ts.map