import { DSMBridgeConfiguration, PLHighlightEngineToken } from '@supernova-studio/pulsar-language'; import { PLAutocompleteEngineSuggestion, PLAutocompleteEngineApplicationResult } from '@supernova-studio/pulsar-language'; import { DSMReferenceStore } from '..'; import { PCExporterSourceContextType } from '../model/sources/ExporterSource'; import { PCLogger } from '../tools/Logger'; import { PCExporter, PCExporterEngine, PCExporterEnvironment } from './../model/exporters/Exporter'; /** Exporter detail containing data about the currently loaded exporter */ export declare class PCEngineExporterDetail { id: string; name: string; description: string; author?: string; organization?: string; homepage: string; source_dir: string; version: string; routingVersion?: string; icon?: string; readme?: string; usesBrands: boolean; usesThemes: boolean; usesLocale: boolean; repository?: { url: string; branch: string; directory: string; }; config?: { sources?: string; output?: string; js?: string; }; engine: PCExporterEngine; executable?: string; tags: Array; } /** Source detail containing data about specific source including its code definition */ export declare class PCEngineSourceDetail { id: string; path: string; targetsFullExport: boolean; targetsSandbox: boolean; context: PCExporterSourceContextType; content: string; } /** Unique, computed file group */ export declare class PCEngineFileGroup { name: string; path: string; files: Array; groups: Array; constructor(name: string, path: string, files: Array, groups: Array); } /** Result of a specific run of a singular exporter. Also used to retrieve export in progress as a way to load files gradually as they are fed and written by the exporter */ export declare type PCEngineExporterProcessingResult = { exporterId: string; runId: string; state: PCEngineExporterState; emittedFiles: Array; rootGroup: PCEngineFileGroup; logger: PCLogger; emittedFileChecksums: Object; }; /** Result of a specific run of a singular source. Can optionally produce multiple files if emitter was used within the source */ export declare type PCEngineSourceProcessingResult = { sourceId: string; logger: PCLogger; producedContent: Array; }; /** File descriptor for one specific file produced by either source, map generation or exporter run */ export declare type PCEngineFileDescriptor = { name: string; path: string; content: string; source: 'primary' | 'emitter'; type: 'string' | 'copy_file' | 'copy_file_remote'; hash?: string; }; export declare enum PCEngineExporterState { running = "running", finished_success = "finished_success", finished_failure = "finished_failure" } export interface PCPulsarInterface { /** 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, environment: PCExporterEnvironment): 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 | undefined, environment: PCExporterEnvironment): Promise; /** Initiates Pulsar library from remote package URL. Can only be used when filesystem is present (CI, VSCode) */ initiateWithRemotePackageURL(s3URL: 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; /** 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 Sources and mapping, use separate functions */ getExporterDetail(): PCEngineExporterDetail; /** Get all Sources associated with loaded exporter. Note that Sources don't contain their code definitions, as those need to be requested separaterly */ getSources(): Array; /** Get specific source associated with loaded exporter */ getSourceById(sourceId: string): PCEngineSourceDetail; setUserConfiguration(data: Object): any; /** Get reference store containing description of all elements in the DSM, including all context categories */ getDSMContextStore(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(sourceId: string, dsmBridgeConfig: DSMBridgeConfiguration, contextKey: string, contextId: string): Promise; /** @deprecated Use PCPulsarStaticAnalysis instead. Suggest next characters, words or snippets to be inserted into pulsar code as user types */ suggestNextFromSourceCode(code: string, selectionLocation: number, selectionLength: number): Array; /** @deprecated Use PCPulsarStaticAnalysis instead. Apply autocompletion result to specified pulsar code */ applyAutocompletionResultToCode(code: string, selectionLocation: number, selectionLength: number, apply: PLAutocompleteEngineSuggestion): PLAutocompleteEngineApplicationResult; /** @deprecated Use PCPulsarStaticAnalysis instead. 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; }