Pulled ALL skills from 15 source repositories: - anthropics/skills: 16 (docs, design, MCP, testing) - obra/superpowers: 14 (TDD, debugging, agents, planning) - coreyhaines31/marketingskills: 25 (marketing, CRO, SEO, growth) - better-auth/skills: 5 (auth patterns) - vercel-labs/agent-skills: 5 (React, design, Vercel) - antfu/skills: 16 (Vue, Vite, Vitest, pnpm, Turborepo) - Plus 13 individual skills from various repos Mosaic Stack is not limited to coding — the Orchestrator and subagents serve coding, business, design, marketing, writing, logistics, analysis, and more. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
79 lines
1.8 KiB
Markdown
79 lines
1.8 KiB
Markdown
---
|
|
category: Browser
|
|
---
|
|
|
|
# usePermission
|
|
|
|
Reactive [Permissions API](https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API). The Permissions API provides the tools to allow developers to implement a better user experience as far as permissions are concerned.
|
|
|
|
## Usage
|
|
|
|
```ts
|
|
import { usePermission } from '@vueuse/core'
|
|
|
|
const microphoneAccess = usePermission('microphone')
|
|
```
|
|
|
|
## Type Declarations
|
|
|
|
```ts
|
|
type DescriptorNamePolyfill =
|
|
| "accelerometer"
|
|
| "accessibility-events"
|
|
| "ambient-light-sensor"
|
|
| "background-sync"
|
|
| "camera"
|
|
| "clipboard-read"
|
|
| "clipboard-write"
|
|
| "gyroscope"
|
|
| "magnetometer"
|
|
| "microphone"
|
|
| "notifications"
|
|
| "payment-handler"
|
|
| "persistent-storage"
|
|
| "push"
|
|
| "speaker"
|
|
| "local-fonts"
|
|
export type GeneralPermissionDescriptor =
|
|
| PermissionDescriptor
|
|
| {
|
|
name: DescriptorNamePolyfill
|
|
}
|
|
export interface UsePermissionOptions<Controls extends boolean>
|
|
extends ConfigurableNavigator {
|
|
/**
|
|
* Expose more controls
|
|
*
|
|
* @default false
|
|
*/
|
|
controls?: Controls
|
|
}
|
|
export type UsePermissionReturn = Readonly<
|
|
ShallowRef<PermissionState | undefined>
|
|
>
|
|
export interface UsePermissionReturnWithControls {
|
|
state: UsePermissionReturn
|
|
isSupported: ComputedRef<boolean>
|
|
query: () => Promise<PermissionStatus | undefined>
|
|
}
|
|
/**
|
|
* Reactive Permissions API.
|
|
*
|
|
* @see https://vueuse.org/usePermission
|
|
*
|
|
* @__NO_SIDE_EFFECTS__
|
|
*/
|
|
export declare function usePermission(
|
|
permissionDesc:
|
|
| GeneralPermissionDescriptor
|
|
| GeneralPermissionDescriptor["name"],
|
|
options?: UsePermissionOptions<false>,
|
|
): UsePermissionReturn
|
|
export declare function usePermission(
|
|
permissionDesc:
|
|
| GeneralPermissionDescriptor
|
|
| GeneralPermissionDescriptor["name"],
|
|
options: UsePermissionOptions<true>,
|
|
): UsePermissionReturnWithControls
|
|
```
|