import { CancellationToken, CancellationTokenSource } from "../../../../base/common/cancellation.js"; import { Event } from "../../../../base/common/event.js"; import { IDisposable } from "../../../../base/common/lifecycle.js"; import { URI } from "../../../../base/common/uri.js"; import { Command } from "../../../../editor/common/languages.js"; import { ExtensionIdentifier } from "../../../../platform/extensions/common/extensions.js"; import { IAccessibilityInformation } from "../../../../platform/accessibility/common/accessibility.js"; import { ThemeIcon } from "../../../../base/common/themables.js"; import { IMarkdownString } from "../../../../base/common/htmlContent.js"; import { IEditableData } from "../../../common/views.js"; export declare function toKey(extension: ExtensionIdentifier | string, source: string): string; export declare const TimelinePaneId = "timeline"; export interface TimelineItem { /** * The handle of the item must be unique across all the * timeline items provided by this source. */ handle: string; /** * The identifier of the timeline provider this timeline item is from. */ source: string; id?: string; /** * When `falsy`, the label is derived from {@link resourceUri}, which is then also used for the icon and file decorations. */ label?: string; description?: string; tooltip?: string | IMarkdownString | undefined; timestamp: number; accessibilityInformation?: IAccessibilityInformation; icon?: URI; iconDark?: URI; themeIcon?: ThemeIcon; command?: Command; contextValue?: string; /** * The resource's content as of this item, used to compare items. */ resourceUri?: URI; relativeTime?: string; relativeTimeFullWord?: string; hideRelativeTime?: boolean; } /** * Signals that timelines of a provider changed. */ export interface TimelineChangeEvent { /** * The identifier of the timeline provider this event is from. */ readonly id: string; /** * Whether the workspace timeline changed, rather than timelines of files and folders. */ readonly workspace: boolean; /** * The files or folders whose timelines changed, or `undefined` if all of * them changed. Always `undefined` for the workspace timeline. */ readonly uris: readonly URI[] | undefined; } export declare enum TimelineTriggerKind { Invoke = 1, Automatic = 2 } export interface TimelineOptions { cursor?: string; limit?: number; triggerKind: TimelineTriggerKind; /** * Internal to the Timeline view: whether the extension host should drop the items it cached for the provider. */ resetCache?: boolean; /** * Internal to the Timeline view: whether the extension host should cache the returned items for commands. */ cacheResults?: boolean; } export interface Timeline { /** * The identifier of the timeline provider this timeline is from. */ source: string; items: TimelineItem[]; /** * A provider-defined cursor for requesting the items after the ones returned, `undefined` if there are no more. */ cursor?: string; } /** * Provides the timelines of files and folders. */ export interface TimelineProvider extends TimelineProviderDescriptor, IDisposable { /** * Fires the files or folders whose timelines changed, or `undefined` if all of them changed. */ readonly onDidChange?: Event; provideTimeline(uri: URI, options: TimelineOptions, token: CancellationToken): Promise; } /** * Provides the timeline of the whole workspace. */ export interface WorkspaceTimelineProvider extends WorkspaceTimelineProviderDescriptor, IDisposable { readonly onDidChange?: Event; provideWorkspaceTimeline(options: TimelineOptions, token: CancellationToken): Promise; } export interface TimelineSource { id: string; label: string; } export interface WorkspaceTimelineProviderDescriptor { /** * An identifier of the source of the timeline items. This can be used to filter sources. */ id: string; /** * A human-readable string describing the source of the timeline items. This can be used as the display label when filtering sources. */ label: string; } export interface TimelineProviderDescriptor extends WorkspaceTimelineProviderDescriptor { /** * The resource scheme(s) this timeline provider is providing entries for. */ scheme: string | readonly string[]; } /** * Signals that timeline sources were added or removed. A source in both `removed` and `added` remains with a * different set of providers, e.g. when only its workspace timeline provider was removed, and is reloaded. */ export interface TimelineProvidersChangeEvent { readonly added?: string[]; readonly removed?: string[]; } export interface TimelineRequest { readonly result: Promise; readonly options: TimelineOptions; readonly source: string; readonly tokenSource: CancellationTokenSource; /** * The file or folder the timeline is requested for, `undefined` for the workspace timeline. */ readonly uri: URI | undefined; } /** * Identifies a timeline item across all timeline providers. */ export interface TimelineItemIdentifier { /** * The identifier of the timeline provider the item is from. */ readonly source: string; /** * The handle of the item, unique across the items of its provider. */ readonly handle: string; } /** * A timeline item that is being edited inline in the Timeline view. */ export interface TimelineEditable { readonly item: TimelineItemIdentifier; readonly data: IEditableData; } export declare const TIMELINE_SERVICE_ID = "timeline";