import { PCExporter, PCExporterEnvironment } from '../model/exporters/Exporter'; import { PCEngineExporterDetail, PCEngineExporterProcessingResult, PCPulsarInterface, PCEngineSourceDetail, PCEngineSourceProcessingResult } from './PulsarInterface'; import { PLHighlightEngineToken, DSMBridgeConfiguration } from '@supernova-studio/pulsar-language'; import { DSMReferenceStore } from '../model/dsm/DSMReferenceStore'; import { PLAutocompleteEngineApplicationResult, PLAutocompleteEngineSuggestion } from '@supernova-studio/pulsar-language'; import { PCLogger } from '../tools/Logger'; export declare enum PCPulsarEngineState { waiting = "waiting", loading = "loading", ready = "ready", finished = "finished" } export declare enum PCPulsarEngineLoadSource { local = "local", github = "github", url = "url", memory = "memory" } export declare enum PCPulsarExporterMode { /** In normal mode, exporter runs fully and produces complete output. This mode requires FS to be present. */ full = "normal", /** In browser mode, exporter runs in memory and /assets/ are ignored both from loading and from exporting. This mode can run when there is no FS present. */ browser = "browser", /** In selective mode, exporter runs similarly to `browser mode`, however, must specify combination of context type and context id and will generate code only for that specific context. This will be used in sandbox and in documentation page refresh down the road. */ selective = "selective" } export declare class PCPulsar implements PCPulsarInterface { private state; private exporter; private mode; private sourceManager; private ciManager; private codeManager; private exporterManager; private configurationManager; private logger; private temporaryFSUrl; private loadSource; constructor(mode: PCPulsarExporterMode, logger?: PCLogger | undefined); /** Initiates Pulsar library from existing exporter. This is only for internal use (especially for tests) and doesn't validate integrity of the exporter, and shouldn't not be used in production! */ initiateWithExporter(exporter: PCExporter): Promise; /** Initiates Pulsar library from a local folder. This must point to directly-readable directory, can't be zip. */ initiateWithLocalFolderURL(url: string, environment: PCExporterEnvironment): Promise; /** Initiates Pulsar library from github URL. Can only be used when filesystem is present (CI, VSCode) */ initiateWithGitHubPackageURL(githubURL: string, accessToken: string, environment: PCExporterEnvironment): Promise; /** Initiates Pulsar library from remote package URL. Can only be used when filesystem is present (CI, VSCode) */ initiateWithRemotePackageURL(packageURL: string, environment: PCExporterEnvironment): Promise; /** Initiates Pulsar library from package URL. Can only be used if filesystem is NOT present (Browser) and ignores some capabilities, such as copying assets */ initiateWithRemoteBrowserPackageURL(packageURL: string, environment: PCExporterEnvironment): Promise; private preInit; private postInit; /** Retrieve underlaying exporter object. Not to be used on the client, as it exposes other properties of exporter that are not to be consumed */ getExporterBackingObject(): PCExporter; /** Retrieve details about currently loaded exporter. Note that this only retrieves settings of the exporter, to request blueprints and mapping, use separate functions */ getExporterDetail(): PCEngineExporterDetail; /** Get temporary URL to which exporter was unpacked */ getLocalFSPackageUrl(): string; setUserConfiguration(data: Object): void; /** Get all blueprints associated with loaded exporter */ getSources(): Array; /** Get specific source associated with loaded exporter */ getSourceById(blueprintId: string): PCEngineSourceDetail; /** Get reference store containing description of all elements in the DSM, including all context categories */ getDSMContextStore(dsmBridgeConfig: DSMBridgeConfiguration): Promise; /** Get reference store containing description of all elements in the DSM, including all context categories. Note this can be called as static method to see the store content regardless of the exporter */ static getDSMContextStoreStatic(dsmBridgeConfig: DSMBridgeConfiguration): Promise; /** Get reference store containing description of all elements in the DSM, including all context categories */ getRequiredDSMData(dsmBridgeConfig: DSMBridgeConfiguration): Promise; /** Execute source code and retrieve the resulting code. This also retrieves any emitted extra files. Throws error when source is not found */ executeSourceById(blueprintId: string, dsmBridgeConfig: DSMBridgeConfiguration, contextKey: string, contextId: string): Promise; /** Update source code definition. Overview can be empty. Throws error when source is not found */ updateSourceCodeDefinitionForSourceId(sourceId: string, definition: string): void; /** Suggest next characters, words or snippets to be inserted into pulsar code as user types */ suggestNextFromSourceCode(code: string, selectionLocation: number, selectionLength: number): Array; /** Apply autocompletion result to specified pulsar code */ applyAutocompletionResultToCode(code: string, selectionLocation: number, selectionLength: number, apply: PLAutocompleteEngineSuggestion): PLAutocompleteEngineApplicationResult; /** Execute source code and retrieve the resulting code in generic mode, with test data. Only use internally for tests */ executeSourceByIdAsGeneric(blueprintId: string): Promise; /** Compute highlight tokens for the provided pulsar code */ suggestHighlightFromSourceCode(code: string): Array; /** Execute entire exporter and retrieve all files produced as a result of this export */ executeExporter(dsmBridgeConfig: DSMBridgeConfiguration, debugMode: boolean): Promise; /** Retrieve intermediate output of exporter in progress */ retrieveRunningExporterState(): PCEngineExporterProcessingResult | null; /** Clean up after the exporter */ cleanup(): void; private validateCanManipulateState; private convertExporterToDetail; private convertSourceToDetail; private convertSourcesToDetails; }