Skip to main content

notificationAPI

MS Code Extension API


MS Code Extension API / core/extensionAPI/modules/window/notificationAPI

core/extensionAPI/modules/window/notificationAPI

Functions

createNotificationAPI()

createNotificationAPI(extId): object

Defined in: core/extensionAPI/modules/window/notificationAPI.ts:9

Factory function to create the Notification API.

Parameters

extId

string

The unique identifier of the extension creating the notifications.

Returns

dismissNotification

dismissNotification: (id) => void

Dismisses a specific notification by its ID.

Parameters
id

string

Returns

void

showConfirmation

showConfirmation: (title, message, actions) => string

Shows a notification with custom buttons (actions).

Parameters
title

string

Notification title.

message

string

The description of the request.

actions

NotificationAction[]

Array of actions with labels and callbacks.

Returns

string

showErrorMessage

showErrorMessage: (message, fullMessage?) => string

Shows an error message toast.

Parameters
message

string

The brief error summary.

fullMessage?

string

Optional detailed error log or stack trace.

Returns

string

The unique ID of the notification.

showInformationMessage

showInformationMessage: (message, ...items) => string

Shows an information message toast.

Parameters
message

string

The primary message text.

items

string[] | NotificationAction[]

Optional buttons or actions.

Returns

string

The unique ID of the notification.

withProgress

withProgress: (title, message) => object

Shows a progress notification that can be updated or completed.

Parameters
title

string

The title of the progress task.

message

string

Initial status message.

Returns

An object to report progress, finish, or error out the task.

done

done: (finalMessage?) => void

Marks the task as completed and dismisses it after a delay.

Parameters
finalMessage?

string

Returns

void

error

error: (err) => void

Converts the progress notification into an error state.

Parameters
err

string

Returns

void

id

id: string

report

report: (updates) => void

Updates the progress message or percentage.

Parameters
updates
message?

string

progress?

number

Returns

void