UNPKG

979 BTypeScriptView Raw
1import { DirectoryPath, DistinctivePath } from '../path';
2import { Potency, Resource } from "../ucan/index";
3export declare type Permissions = {
4 app?: AppInfo;
5 fs?: FileSystemPermissions;
6 platform?: PlatformPermissions;
7 raw?: RawPermissions;
8};
9export declare type AppInfo = {
10 name: string;
11 creator: string;
12};
13export declare type FileSystemPermissions = {
14 private?: Array<DistinctivePath>;
15 public?: Array<DistinctivePath>;
16};
17export declare type PlatformPermissions = {
18 apps: '*' | Array<string>;
19};
20export declare type RawPermissions = Array<RawPermission>;
21export declare type RawPermission = {
22 exp: number;
23 rsc: Resource;
24 ptc: Potency;
25};
26/**
27 * Path for `AppInfo`.
28 */
29export declare function appDataPath(app: AppInfo): DirectoryPath;
30/**
31 * Lists the filesystems paths for a set of `Permissions`.
32 * This'll return a list of `DistinctivePath`s.
33 */
34export declare function paths(permissions: Permissions): DistinctivePath[];