@modular/sdk/view
137 exports in 5 groups.
Interfaces66
- AiViewApiinterfaceagents, models, sessions, tools, transcription, ask()
- AiViewToolsApiinterfaceregister()
- CancellationTokeninterfaceA cancellation token is passed to an asynchronous or long running operation to request cancellation, like cancelling a request for completion items because the user continued to type. To get an instance of a `CancellationToken` use a CancellationTokenSource.
- CommandsViewApiinterfaceRuns a command: one of this mod's own declarations, or any registered command by id, including commands the host and other mods own. Pass the `command(...)` value itself and the result is the handler's own return type; the host qualifies the id for you.
- ConfigurationChangeEventinterfaceAn event describing the change in Configuration
- ContextBaseinterfaceEverything every handler in a mod can reach. The shape is a split: state and events are how you read the app, actions are how you change it.
- DataTransferFileinterfaceA file associated with a DataTransferItem. Instances of this type can only be created by the editor and not by extensions.
- EventinterfaceRepresents a typed event. A function that represents an event to which you subscribe by calling it with a listener function as argument.
- EventOccurrenceinterfaceOne delivery of an event to your listener. Dispatch through `occurrence.action(...)` rather than `ctx.action(...)` when you react to an event.
- FileChangeEventinterfaceThe event filesystem providers must use to signal a file change.
- FileCreateEventinterfaceAn event that is fired after files are created.
- FileDeleteEventinterfaceAn event that is fired after files are deleted.
- FileRenameEventinterfaceAn event that is fired after files are renamed.
- FileStatinterfaceThe `FileStat`-type represents metadata about a file
- FileSysteminterfaceThe file system interface exposes the editor's built-in and contributed file system providers.
- FileSystemProviderinterfaceThe filesystem provider defines what the editor needs to read, write, discover, and to manage files and folders.
- FileSystemWatcherinterfaceA file system watcher notifies about changes to files and folders on disk or from other FileSystemProviders. To get an instance of a `FileSystemWatcher` use workspace.createFileSystemWatcher createFileSystemWatcher.
- FileWillCreateEventinterfaceAn event that is fired when files are going to be created. To make modifications to the workspace before the files are created, call the waitUntil-function with a thenable that resolves to a workspace edit.
- FileWillDeleteEventinterfaceAn event that is fired when files are going to be deleted. To make modifications to the workspace before the files are deleted, call the `waitUntil`-function with a thenable that resolves to a workspace edit.
- FileWillRenameEventinterfaceAn event that is fired when files are going to be renamed. To make modifications to the workspace before the files are renamed, call the `waitUntil`-function with a thenable that resolves to a workspace edit.
- HostActionContextinterfaceThe context an interceptor runs in, not the one a handler runs in. It is deliberately narrower than ContextBase.
- HostActionEnvelopeinterfaceOne action in flight, with everything an interceptor needs to judge it. The envelope answers who asked, from where, in what scope, and with what input.
- HostActionRunnerinterfaceDispatches actions from inside an interceptor, where `ctx.action(...)` of the outer context is not in reach.
- HostContextinterfaceThe context for code the host runs inside the renderer itself: editor extensions, canvas elements, and React UI reached through `useMod()`. It carries the same capabilities as a view minus the panel.
- HostHookClientinterfaceRegisters interceptors at runtime. Use this when the decision needs code.
- LoggerinterfaceYour mod's log channel in the host. Use it instead of `console`, which is forbidden at module top level.
- NotebookCellinterfaceRepresents a cell of a notebook, either a code-cell or markup-cell. NotebookCell instances are immutable and are kept in sync for as long as they are part of their notebook.
- NotebookCellExecutionSummaryinterfaceThe summary of a notebook cell execution.
- NotebookDocumentinterfaceRepresents a notebook which itself is a sequence of code or markup cells.
- NotebookDocumentCellChangeinterfaceDescribes a change to a notebook cell.
- NotebookDocumentChangeEventinterfaceAn event describing a transactional notebook change.
- NotebookDocumentContentChangeinterfaceDescribes a structural change to a notebook document, e.g newly added and removed cells.
- NotebookDocumentContentOptionsinterfaceNotebook content options define what parts of a notebook are persisted.
- NotebookDocumentWillSaveEventinterfaceAn event that is fired when a notebook document will be saved. To make modifications to the document before it is being saved, call the waitUntil-function with a thenable that resolves to a workspace edit.
- NotebookSerializerinterfaceThe notebook serializer enables the editor to open notebook files. At its core the editor only knows a notebook data structure but not how that data structure is written to a file, nor how it is read from a file.
- OwnedStateinterfaceA writable handle to state your own mod declared. Returned by `ctx.state(declaration)` when you pass the value you built with state.
- PermissionClientinterfaceReads what the user has granted, denied, and is being asked right now. This is an observation surface.
- ReadonlySignalinterfaceA value you can read now and be told about later. The host hands these out for state it owns, so a mod never polls.
- SdkViewWorkspaceinterfaceworkspace, dispose()
- StateinterfaceA read-only handle to one state value. Returned by `ctx.state('editor.selection')` and the other built-in state names.
- StateDefinitionBoundaryPropsinterfacechildren, observeRefreshApplied, observeStateDefinitions, onError, onSettled
- TextDocumentinterfaceRepresents a text document, such as a source file.
- TextDocumentChangeEventinterfaceAn event describing a transactional document change.
- TextDocumentContentChangeEventinterfaceAn event describing an individual change in the text of a document.
- TextDocumentContentProviderinterfaceA text document content provider allows to add readonly documents to the editor, such as source from a dll or generated html from md. Content providers are workspace.registerTextDocumentContentProvider registered for a uri-scheme.
- TextDocumentWillSaveEventinterfaceAn event that is fired when a document will be saved. To make modifications to the document before it is being saved, call the waitUntil-function with a thenable that resolves to an array of text edits.
- TextLineinterfaceRepresents a line of text, such as a line of source code. TextLine objects are __immutable__.
- ThenableinterfaceThenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise, and others.
- UiCancellationTokeninterfaceisCancellationRequested, onCancellationRequested()
- UiCapabilityinterfacedialog, notification, progress, quickInput
- UiDialogCapabilityinterfaceconfirm()
- UiNotificationCapabilityinterfaceask(), error(), info(), warning()
- UiProgressCapabilityinterfacewithProgress()
- UiProgressReporterinterfacereport()
- UiQuickInputCapabilityinterfaceinput(), pick()
- ViewContextinterfaceThe context a panel declared with `view(...)` receives, through `useViewContext()`. The two members that only exist here are `viewId` and `diagnostics`: a view is a panel the host mounts, so it has an identity in the layout and it owes the host a report on whether it rendered.
- ViewContextProviderPropsinterfacechildren, value
- ViewDiagnosticsinterfaceHow a view tells the host whether it actually rendered. The runtime graph and the eval harness read only this channel.
- WorkbenchEditorinterfaceA mounted Studio document.
- WorkbenchScreenshotOptionsinterfacefullPage, timeout
- WorkspaceApiinterfaceNamespace for dealing with the current workspace.
- WorkspaceConfigurationinterfaceRepresents the configuration.
- WorkspaceEditEntryMetadatainterfaceAdditional data for entries of a workspace edit.
- WorkspaceEditMetadatainterfaceAdditional data about a workspace edit.
- WorkspaceFolderinterfaceA workspace folder is one of potentially many roots opened by the editor.
- WorkspaceFoldersChangeEventinterfaceAn event describing a change to the set of workspace.workspaceFolders workspace folders.
Types35
- ConfigurationScopetypeThe configuration scope which can be: - a Uri representing a resource - a TextDocument representing an open text document - a WorkspaceFolder representing a workspace folder - an object containing: - `uri`: an optional Uri of a text document - `languageId`: the language identifier of a text document
- ConfigurationTargettypeThe configuration target
- Disposabletypetypes.Disposable
- EndOfLinetypetypes.EndOfLine
- EventEmittertypetypes.EventEmitter<T>
- FileChangeTypetypetypes.FileChangeType
- FilePermissiontypetypes.FilePermission
- FileSystemErrortypetypes.FileSystemError
- FileTypetypetypes.FileType
- GlobPatterntypeA file glob pattern to match file paths against.
- HostActionInterceptortypeMiddleware around one action. Call `next(action.input)` to let it run untouched.
- HostActionNexttypeHands control to the rest of the interceptor chain and then to the action owner. Pass the input through unchanged to observe, or pass a rewritten input to change what actually runs.
- IconPathtypeRepresents an icon in the UI.
- MarkdownStringtypetypes.MarkdownString
- NotebookCellDatatypetypes.NotebookCellData
- NotebookCellKindtypetypes.NotebookCellKind
- NotebookCellOutputtypetypes.NotebookCellOutput
- NotebookCellOutputItemtypetypes.NotebookCellOutputItem
- NotebookDatatypetypes.NotebookData
- NotebookEdittypetypes.NotebookEdit
- NotebookRangetypetypes.NotebookRange
- Positiontypetypes.Position
- ProviderResulttypeA provider result represents the values a provider, like the HoverProvider, may return.
- Rangetypetypes.Range
- RelativePatterntypetypes.RelativePattern
- SnippetStringtypetypes.SnippetString
- SnippetTextEdittypetypes.SnippetTextEdit
- TextDocumentChangeReasontypetypes.TextDocumentChangeReason
- TextDocumentSaveReasontypeRepresents reasons why a text document is saved.
- TextEdittypetypes.TextEdit
- ThemeColortypetypes.ThemeColor
- ThemeIcontypetypes.ThemeIcon
- Uritypetypes.Uri
- ViewRenderOutcometypeHow a render attempt settled.
- WorkspaceEdittypetypes.WorkspaceEdit
Functions6
- commandActionIdfunction(commandId: string) => CommandHostActionId
- commandIdFromActionIdfunction(actionId: string) => string | null
- useModMetadatafunction<TValue>(metadata: BoundMetadata<TValue>) => TValue
- useModStatefunction<TValue>(state: State<TValue>) => StateSnapshot<TValue>
- useViewContextfunction() => ViewContext
- ViewContextProviderfunction(props: ViewContextProviderProps) => ReactNode
Classes1
Values29
- COMMAND_HOST_ACTION_PREFIXconst"command:"
- ConfigurationTargetconstThe configuration target
- Disposableconsttypeof types.Disposable
- EndOfLineconsttypeof types.EndOfLine
- EventEmitterconsttypeof types.EventEmitter
- FileChangeTypeconsttypeof types.FileChangeType
- FilePermissionconsttypeof types.FilePermission
- FileSystemErrorconsttypeof types.FileSystemError
- FileTypeconsttypeof types.FileType
- MarkdownStringconsttypeof types.MarkdownString
- NotebookCellDataconsttypeof types.NotebookCellData
- NotebookCellKindconsttypeof types.NotebookCellKind
- NotebookCellOutputconsttypeof types.NotebookCellOutput
- NotebookCellOutputItemconsttypeof types.NotebookCellOutputItem
- NotebookDataconsttypeof types.NotebookData
- NotebookEditconsttypeof types.NotebookEdit
- NotebookRangeconsttypeof types.NotebookRange
- Positionconsttypeof types.Position
- Rangeconsttypeof types.Range
- RelativePatternconsttypeof types.RelativePattern
- SnippetStringconsttypeof types.SnippetString
- SnippetTextEditconsttypeof types.SnippetTextEdit
- TextDocumentChangeReasonconsttypeof types.TextDocumentChangeReason
- TextDocumentSaveReasonconstRepresents reasons why a text document is saved.
- TextEditconsttypeof types.TextEdit
- ThemeColorconsttypeof types.ThemeColor
- ThemeIconconsttypeof types.ThemeIcon
- Uriconsttypeof types.Uri
- WorkspaceEditconsttypeof types.WorkspaceEdit