UNPKG

@hpcc-js/comms

Version:
124 lines (123 loc) 3.98 kB
import { Dictionary, DictionaryNoCase, XMLNode } from "@hpcc-js/util"; import { ClientTools } from "./eclcc.ts"; export interface IFilePath { scope: ECLScope; } export declare class Attr { __attrs: { [id: string]: string; }; name: string; constructor(xmlAttr: XMLNode); } export declare class Field { __attrs: { [id: string]: string; }; definition: Definition; get scope(): ECLScope; name: string; type: string; constructor(definition: Definition, xmlField: XMLNode); } export interface ECLDefinitionLocation { filePath: string; line: number; charPos: number; definition?: Definition; source?: Source; } export interface ISuggestion { name: string; type: string; } export declare class ECLScope implements IFilePath { get scope(): ECLScope; name: string; type: string; sourcePath: string; line: number; start: number; body: number; end: number; definitions: Definition[]; constructor(name: string, type: string, sourcePath: string, xmlDefinitions: XMLNode[], line?: number, start?: number, body?: number, end?: number); private parseDefinitions; contains(charOffset: number): boolean; scopeStackAt(charOffset: number): ECLScope[]; private _resolve; resolve(qualifiedID: string): Definition | undefined; suggestions(): ISuggestion[]; } export declare class Definition extends ECLScope { __attrs: { [id: string]: string; }; exported: boolean; shared: boolean; fullname: string; inherittype: string; attrs: Attr[]; fields: Field[]; constructor(sourcePath: string, xmlDefinition: XMLNode); private parseAttrs; private parseFields; suggestions(): ISuggestion[]; } export declare class Import { __attrs: { [id: string]: string; }; name: string; ref: string; start: number; end: number; line: number; constructor(xmlImport: XMLNode); } export declare class Source extends ECLScope { imports: Import[]; __attrs: { [id: string]: string; }; constructor(xmlSource: XMLNode); private parseImports; resolve(qualifiedID: string, charOffset?: number): Definition | undefined; } export declare class File extends ECLScope { constructor(name: string, sourcePath: string); suggestions(): ISuggestion[]; } export declare class Folder extends ECLScope { constructor(name: string, sourcePath: string); suggestions(): ISuggestion[]; } export declare class Workspace { _workspacePath: string; _eclccPath?: string; _clientTools: ClientTools; _sourceByID: DictionaryNoCase<Source>; _sourceByPath: Dictionary<Source>; private _test; constructor(workspacePath: string, eclccPath?: string); refresh(): void; primeClientTools(): Promise<this>; primeWorkspace(): void; walkChildFolders(folderPath: string, refPath: string, force?: boolean): void; visitFile(filePath: string, refPath: string, force?: boolean): void; visitFolder(folderPath: string, refPath: string, force?: boolean): void; buildStack(parentStack: string[], name: string, removeDupID: boolean): { stack: string[]; qid: string; }; walkECLScope(parentStack: string[], scope: ECLScope): void; walkField(parentStack: string[], field: Field): void; walkDefinition(parentStack: string[], definition: Definition): void; walkSource(source: Source): void; parseSources(sources?: XMLNode[]): void; parseMetaXML(metaXML: string): string[]; resolveQualifiedID(filePath: string, qualifiedID: string, charOffset?: number): ECLScope | undefined; resolvePartialID(filePath: string, partialID: string, charOffset: number): ECLScope | undefined; } export declare function attachWorkspace(_workspacePath: string, eclccPath?: string): Workspace; export declare function qualifiedIDBoundary(lineText: string, charPos: number, reverse: boolean): number;