@deployport/specular-runtime
Version:
Runtime for Specular API clients with support for Node.js and Browser
32 lines (31 loc) • 1.2 kB
TypeScript
import Content from "../runtime/content.js";
import Package, { PackagePath } from "./package.js";
import { GenericProperties, SerializedProperties } from "../runtime/struct.js";
import Property from "./property.js";
import UserDefinedType from "./userDefinedType.js";
export declare class StructPath {
readonly module: PackagePath;
readonly name: string;
readonly mediaType: string;
constructor(module: PackagePath, name: string);
toString(): string;
static fromString(str: string): StructPath;
}
export default class Struct implements UserDefinedType {
readonly name: string;
readonly package: Package;
readonly path: StructPath;
private readonly properties;
constructor(pkg: Package, name: string);
problemInstantiate: ((msg: string) => any) | null;
instantiate(content: Content | null): any;
get mediaType(): string;
_addProperty(prop: Property): void;
propertyByName(name: string): Property | null;
/**
* Returns properties ready to be send over the network.
*/
serialize(props: GenericProperties): Promise<SerializedProperties>;
deserialize(content: Content): GenericProperties;
private deserializeStruct;
}