lumiverse-spindle-types 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/dom.ts +10 -2
- package/src/index.ts +1 -0
package/package.json
CHANGED
package/src/dom.ts
CHANGED
|
@@ -158,6 +158,13 @@ export interface SpindleMessageTagInterceptorOptions {
|
|
|
158
158
|
removeFromMessage?: boolean;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
/** Options for `permissions.request()` — displayed in the system confirmation modal. */
|
|
162
|
+
export interface PermissionRequestOptions {
|
|
163
|
+
/** Human-readable explanation of why the extension needs these permissions.
|
|
164
|
+
* Shown to the user in the confirmation modal. */
|
|
165
|
+
reason?: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
161
168
|
/** Context object provided to frontend extension modules */
|
|
162
169
|
export interface SpindleFrontendContext {
|
|
163
170
|
dom: SpindleDOMHelper;
|
|
@@ -183,9 +190,10 @@ export interface SpindleFrontendContext {
|
|
|
183
190
|
permissions: {
|
|
184
191
|
getGranted(): Promise<string[]>;
|
|
185
192
|
/** Request that the given permissions be granted. Returns the updated granted list.
|
|
193
|
+
* A system-level confirmation modal is shown to the user before any permissions are applied.
|
|
186
194
|
* Privileged permissions (e.g. cors_proxy) require admin/owner approval.
|
|
187
|
-
*
|
|
188
|
-
request(permissions: string[]): Promise<string[]>;
|
|
195
|
+
* Rejects with an error if the user denies the request. */
|
|
196
|
+
request(permissions: string[], options?: PermissionRequestOptions): Promise<string[]>;
|
|
189
197
|
};
|
|
190
198
|
sendToBackend(payload: unknown): void;
|
|
191
199
|
onBackendMessage(handler: (payload: unknown) => void): () => void;
|