import * as theia from '@theia/plugin'; import { CancellationToken } from '@theia/core/lib/common/cancellation'; import { Event } from '@theia/core'; import { TestingExt, TestingMain } from '../common/plugin-api-rpc'; import { CommandRegistryImpl } from './command-registry'; import { RPCProtocol } from '../common/rpc-protocol'; import { TestItemImpl, TestItemCollection } from './test-item'; import { TreeDelta } from '@theia/test/lib/common/tree-delta'; import { TestItemDTO, TestRunProfileDTO, TestRunProfileKind, TestRunRequestDTO, TestItemReference, TestMessageArg, TestMessageDTO, TestMessageStackFrameDTO } from '../common/test-types'; import * as protocol from '@theia/core/shared/vscode-languageserver-protocol'; import { Location, Position, Range } from './types-impl'; type RefreshHandler = (token: theia.CancellationToken) => void | theia.Thenable; type ResolveHandler = (item: theia.TestItem | undefined) => theia.Thenable | void; export declare class TestControllerImpl implements theia.TestController { private onDispose; protected readonly proxy: TestingMain; readonly id: string; private _label; protected readonly _profiles: Map; private activeRuns; private deltaBuilder; private _refreshHandler?; private _resolveHandler?; constructor(onDispose: () => void, proxy: TestingMain, id: string, _label: string); mapDeltas(deltas: TreeDelta[]): TreeDelta[]; mapDelta(delta: TreeDelta): TreeDelta; readonly items: TestItemCollection; get label(): string; set label(value: string); get refreshHandler(): RefreshHandler | undefined; set refreshHandler(value: RefreshHandler | undefined); get resolveHandler(): ResolveHandler | undefined; set resolveHandler(handler: ResolveHandler | undefined); getProfile(id: string): TestRunProfile | undefined; createRunProfile(label: string, kind: TestRunProfileKind, runHandler: (request: theia.TestRunRequest, token: CancellationToken) => Thenable | void, isDefault?: boolean, tag?: theia.TestTag, supportsContinuousRun?: boolean): theia.TestRunProfile; createTestItem(id: string, label: string, uri?: theia.Uri): theia.TestItem; createTestRun(request: theia.TestRunRequest, name?: string, persist?: boolean): theia.TestRun; dispose(): void; runTestsForUI(profileId: string, name: string, includedTests: string[][], excludedTests: string[][], preserveFocus: boolean): void; cancelRun(runId?: string): void; invalidateTestResults(items?: theia.TestItem | readonly theia.TestItem[] | undefined): void; } export declare function checkTestRunInstance(item: theia.TestRun): TestRun; export declare function checkTestRunInstance(item?: theia.TestRun): TestRun | undefined; export declare class TestRun implements theia.TestRun { readonly controller: TestControllerImpl; private readonly proxy; readonly name: string; readonly isPersisted: boolean; private onDidEndEmitter; onDidEnd: Event; private onWillFlushEmitter; onWillFlush: Event; private onDidDisposeEmitter; onDidDispose: Event; readonly id: string; private testStateDeltas; private testOutputDeltas; private changeBatcher; private ended; private tokenSource; constructor(controller: TestControllerImpl, proxy: TestingMain, name: string, isPersisted: boolean, isRunning: boolean, preserveFocus: boolean); get token(): CancellationToken; enqueued(test: theia.TestItem): void; started(test: theia.TestItem): void; skipped(test: theia.TestItem): void; failed(test: theia.TestItem, message: theia.TestMessage | readonly theia.TestMessage[], duration?: number | undefined): void; errored(test: theia.TestItem, message: theia.TestMessage | readonly theia.TestMessage[], duration?: number | undefined): void; passed(test: theia.TestItem, duration?: number | undefined): void; appendOutput(output: string, location?: theia.Location | undefined, test?: theia.TestItem | undefined): void; end(): void; /** @stubbed */ addCoverage(fileCoverage: theia.FileCoverage): void; private checkNotEnded; private updateTestState; emitChange(): void; cancel(): void; } export declare class TestingExtImpl implements TestingExt { private readonly controllersById; private readonly proxy; constructor(rpc: RPCProtocol, commands: CommandRegistryImpl); fromTestMessageArg(arg: TestMessageArg): { test?: theia.TestItem; message: theia.TestMessage; }; toTestMessage(testMessage: TestMessageDTO): theia.TestMessage; toLocation(location: protocol.Location | undefined): Location | undefined; toRange(range: protocol.Range): Range; toPosition(position: protocol.Position): Position; toPosition(position: protocol.Position | undefined): Position | undefined; toStackFrame(stackFrame: TestMessageStackFrameDTO): theia.TestMessageStackFrame; toTestItem(ref: TestItemReference): theia.TestItem; protected withController(controllerId: string): TestControllerImpl; $onResolveChildren(controllerId: string, path: string[]): void; /** * Implements theia.test.registerTestProvider */ createTestController(controllerId: string, label: string): theia.TestController; /** @inheritdoc */ $onConfigureRunProfile(controllerId: string, profileId: string): void; /** @inheritdoc */ $onDidChangeDefault(controllerId: string, profileId: string, isDefault: boolean): void; /** @inheritdoc */ $refreshTests(controllerId: string, token: CancellationToken): Promise; /** * Runs tests with the given set of IDs. Allows for test from multiple * providers to be run. * @override */ $onRunControllerTests(reqs: TestRunRequestDTO[]): void; runTestsForUI(req: TestRunRequestDTO): void; /** * Cancels an ongoing test run. */ $onCancelTestRun(controllerId: string, runId: string): void; } export declare class TestRunProfile implements theia.TestRunProfile { readonly controllerId: string; readonly profileId: string; readonly kind: theia.TestRunProfileKind; runHandler: (request: theia.TestRunRequest, token: theia.CancellationToken) => Thenable | void; private readonly proxy; supportsContinuousRun: boolean; constructor(proxy: TestingMain, controllerId: string, profileId: string, label: string, kind: theia.TestRunProfileKind, runHandler: (request: theia.TestRunRequest, token: theia.CancellationToken) => Thenable | void, isDefault?: boolean, tag?: theia.TestTag | undefined); protected notifyPropertyChange(property: keyof TestRunProfileDTO, value: any): void; label: string; _isDefault: boolean; get isDefault(): boolean; set isDefault(isDefault: boolean); doSetDefault(isDefault: boolean): boolean; private onDidChangeDefaultEmitter; onDidChangeDefault: Event; tag: theia.TestTag | undefined; protected notifyTagChange(_property: keyof TestRunProfileDTO, value?: theia.TestTag): void; configureHandler: () => void | undefined; protected notifyConfigureHandlerChange(_property: keyof TestRunProfileDTO, value?: () => void): void; dispose(): void; } export {}; //# sourceMappingURL=tests.d.ts.map