less prototype, less bad code implementation of CCHM type theory
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
927 B

export class Program { };
export class Environment { };
export class Value { };
export type Posn = {
posnLine: number,
posnColm: number
};
export type Range = [Posn, Posn];
export type CubicalT = {
exports: {
parseFromStringJs(s: string): Promise<Program>;
newEnvironment(): Promise<Environment>;
typeCheckProgram(p: Environment, e: Program): Promise<Environment>;
zonkAndShowTypeJs(val: Value): Promise<string>;
getTypeByNameJs(name: string, e: Environment): Promise<Value>;
getValueByNameJs(name: string, e: Environment): Promise<Value>;
classifyValueByNameJs(name: string, e: Environment): Promise<string>;
findDefinitionJs(name: string, e: Environment): Promise<Range | null>;
}
};
export const waitForLoad : Promise<CubicalT> = new Promise(resolve =>
document.addEventListener('cubicalLoaded', () => {
resolve((window as unknown as { cubical: CubicalT}).cubical)
}));