derw
Version:
An Elm-inspired language that transpiles to TypeScript
13 lines (12 loc) • 1.23 kB
TypeScript
import { Result } from "@eeue56/ts-core/build/main/lib/result";
import { Block, CaseStatement, Expression, Function, Import, ObjectLiteralType, Type, TypedBlock } from "./types";
type ScopedValues = Record<string, Type>;
export declare function isSameType(first: Type, second: Type, topLevel: boolean, typedBlocks?: TypedBlock[]): boolean;
export declare function inferType(expression: Expression, expectedType: Type, typedBlocks: TypedBlock[], imports: Import[], valuesInScope: ScopedValues): Result<string, Type>;
export declare function getCasesFromFunction(block: Function): CaseStatement[];
export declare function validateAllCasesCovered(block: Block, typedBlocks: TypedBlock[]): string[];
export declare function validateObjectLiteralType(objectLiteralType: ObjectLiteralType, expectedType: Type, typedBlocks: TypedBlock[], imports: Import[]): Result<string, null>;
export declare function findReplacement(inferredType: Type, expectedType: Type, typedBlocks: TypedBlock[]): Type;
export declare function getValuesInTopLevelScope(blocks: Block[]): ScopedValues;
export declare function validateType(block: Block, typedBlocks: TypedBlock[], imports: Import[], valuesInScope?: ScopedValues): Result<string, Type>;
export {};