@forge/bridge

5.10.3-next.1-experimental-919607a5.11.0-next.2
out/permissions/permissionsUtil.d.ts
+out/permissions/permissionsUtil.d.tsNew file
+39
Index: package/out/permissions/permissionsUtil.d.ts
===================================================================
--- package/out/permissions/permissionsUtil.d.ts
+++ package/out/permissions/permissionsUtil.d.ts
@@ -0,0 +1,39 @@
+import type { External } from '@forge/manifest';
+import type { RuntimePermissions } from '../types';
+declare const RESOURCE_TYPES: readonly ["fonts", "styles", "frames", "images", "media", "scripts"];
+export declare type ResourceType = (typeof RESOURCE_TYPES)[number];
+declare const FETCH_TYPES: readonly ["backend", "client"];
+export declare type FetchType = (typeof FETCH_TYPES)[number];
+export interface PermissionRequirements {
+    scopes?: string[];
+    external?: {
+        fetch?: {
+            backend?: string[];
+            client?: string[];
+        };
+        fonts?: string[];
+        styles?: string[];
+        frames?: string[];
+        images?: string[];
+        media?: string[];
+        scripts?: string[];
+    };
+    content?: Record<string, unknown>;
+}
+export declare type MissingPermissions = PermissionRequirements;
+export interface PermissionCheckResult {
+    granted: boolean;
+    missing: MissingPermissions | null;
+}
+export interface PermissionUtils {
+    hasScope: (scope: string) => boolean;
+    canFetchFrom: (type: FetchType, url: string) => boolean;
+    canLoadResource: (type: ResourceType, url: string) => boolean;
+    getScopes: () => string[];
+    getExternalPermissions: () => External | undefined;
+    hasAnyPermissions: () => boolean;
+}
+export declare function createPermissionUtils(runtimePermissions: RuntimePermissions | undefined): PermissionUtils | null;
+export declare function checkPermissions(requiredPermissions: PermissionRequirements, runtimePermissions?: RuntimePermissions | undefined): Promise<PermissionCheckResult>;
+export {};
+//# sourceMappingURL=permissionsUtil.d.ts.map
\ No newline at end of file