onelang
Version:
OneLang transpiler framework core
76 lines (75 loc) • 2.13 kB
TypeScript
import { LangFileSchema } from "../Generator/LangFileSchema";
export declare class PackageId {
type: "Interface" | "Implementation";
name: string;
version: string;
}
export interface PackageContent {
id: PackageId;
files: {
[path: string]: string;
};
fromCache: boolean;
}
export interface PackageBundle {
packages: PackageContent[];
}
export interface PackageSource {
getPackageBundle(ids: PackageId[], cachedOnly: boolean): Promise<PackageBundle>;
getAllCached(): Promise<PackageBundle>;
}
export interface PackageNativeImpl {
packageName: string;
fileName: string;
code: string;
}
export interface InterfaceYaml {
"file-version": number;
vendor: string;
name: string;
version: number;
"definition-file": string;
}
export declare class InterfacePackage {
content: PackageContent;
interfaceYaml: InterfaceYaml;
definition: string;
constructor(content: PackageContent);
}
export declare class ImplPkgImplementation {
interface: {
name: string;
minver: number;
maxver: number;
};
language: string;
"native-includes": string[];
"native-includes-dir": string;
implementation: LangFileSchema.LangFile;
}
export declare class ImplPackageYaml {
"file-version": number;
vendor: string;
name: string;
description: string;
version: number;
includes: string[];
implements: ImplPkgImplementation[];
}
export declare class ImplementationPackage {
content: PackageContent;
implementationYaml: ImplPackageYaml;
implementations: ImplPkgImplementation[];
constructor(content: PackageContent);
}
export declare class PackageManager {
source: PackageSource;
intefacesPkgs: InterfacePackage[];
implementationPkgs: ImplementationPackage[];
constructor(source: PackageSource);
loadAllCached(): Promise<void>;
getLangImpls(langName: string): ImplPkgImplementation[];
loadImplsIntoLangFile(lang: LangFileSchema.LangFile): void;
getInterfaceDefinitions(): string;
getLangNativeImpls(langName: string): PackageNativeImpl[];
}