Types
Snippet Types
Types for VS Code snippet JSON format and namespace utilities.
Interfaces
Type Aliases
Functions
qualifySnippetPrefix
TypeScript
function qualifySnippetPrefix(namespace, rawPrefix): string;Defined in: packages/snippets/src/types.ts:56
Qualify a snippet prefix with its extension namespace. Format: “namespace:rawPrefix”.
Parameters
| Parameter | Type | Description |
|---|---|---|
namespace |
string |
Extension namespace (from snippetNamespace). |
rawPrefix |
string |
Original snippet prefix. |
Returns
string
Qualified prefix string.
snippetNamespace
TypeScript
function snippetNamespace(id): string;Defined in: packages/snippets/src/types.ts:44
Compute the namespace string for an extension. Format: “owner-name” when an owner exists, “name” otherwise.
Parameters
| Parameter | Type | Description |
|---|---|---|
id |
SnippetExtensionId |
Extension identifier. |
Returns
string
Namespace string.
SnippetDefinition
Defined in: packages/snippets/src/types.ts:22
A single snippet definition in VS Code snippet JSON format.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
body |
string | string[] |
Body lines of the snippet (joined with newlines on insertion). | packages/snippets/src/types.ts:26 |
description? |
string |
Human-readable description shown in IntelliSense. | packages/snippets/src/types.ts:28 |
prefix |
string | string[] |
Trigger prefix(es) for the snippet. | packages/snippets/src/types.ts:24 |
SnippetExtensionId
Defined in: packages/snippets/src/types.ts:12
Extension identifier for snippet namespacing. Structurally compatible with @quarto-wizard/core’s ExtensionId.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
name |
string |
The name of the extension. | packages/snippets/src/types.ts:16 |
owner |
string | null |
The owner (user or organisation) of the extension, or null if unowned. | packages/snippets/src/types.ts:14 |
SnippetCollection
TypeScript
type SnippetCollection = Record<string, SnippetDefinition>;Defined in: packages/snippets/src/types.ts:35
A collection of named snippet definitions. Keys are human-readable snippet names; values are the definitions.