import { getTemplateById } from '@sanity/initial-value-templates'; import { InitialValueTemplateItem } from '@sanity/structure'; import { Observable } from 'rxjs'; import { PermissionCheckResult } from './types'; declare type Template = ReturnType; export interface TemplatePermissionsResult> extends PermissionCheckResult, InitialValueTemplateItem { granted: boolean; reason: string; resolvedInitialValue: TInitialValue; subtitle?: string; template: Template; } declare type Serializable = { serialize(): T; }; /** * The observable version of `useTemplatePermissions` */ declare function getTemplatePermissions(initialValueTemplateItems: Array>): Observable>>>; /** * Takes in an array of initial template values and returns an object of * `TemplatePermissionsResult` keyed by the IDs of the initial template values * given. * * The `TemplatePermissionsResult` is an object that contains a `granted` * boolean per key and can be used to determine if a user has the ability to * create documents using the given initial value template items. * * For each initial template value item, the corresponding template is found and * resolved against the parameters in each the initial template value item. The * resolved value is then run through the document-value permissions. If there * are any matching grants for the resolved initial template value, the * `TemplatePermissionsResult` will include `granted: true`. */ declare const useTemplatePermissions: (initialValueTemplateItems: (InitialValueTemplateItem | Serializable)[]) => [TemplatePermissionsResult>[], boolean]; export { getTemplatePermissions as unstable_getTemplatePermissions, useTemplatePermissions as unstable_useTemplatePermissions, }; //# sourceMappingURL=templatePermissions.d.ts.map