1 | import { Maybe } from './common/index';
|
2 | import { Permissions } from './ucan/permissions';
|
3 | import FileSystem from './fs/index';
|
4 | export declare enum Scenario {
|
5 | NotAuthorised = "NOT_AUTHORISED",
|
6 | AuthSucceeded = "AUTH_SUCCEEDED",
|
7 | AuthCancelled = "AUTH_CANCELLED",
|
8 | Continuation = "CONTINUATION"
|
9 | }
|
10 | export declare type State = NotAuthorised | AuthSucceeded | AuthCancelled | Continuation;
|
11 | export declare type NotAuthorised = {
|
12 | scenario: Scenario.NotAuthorised;
|
13 | permissions: Maybe<Permissions>;
|
14 | authenticated: false;
|
15 | };
|
16 | export declare type AuthSucceeded = {
|
17 | scenario: Scenario.AuthSucceeded;
|
18 | permissions: Maybe<Permissions>;
|
19 | authenticated: true;
|
20 | newUser: boolean;
|
21 | throughLobby: true;
|
22 | username: string;
|
23 | fs?: FileSystem;
|
24 | };
|
25 | export declare type AuthCancelled = {
|
26 | scenario: Scenario.AuthCancelled;
|
27 | permissions: Maybe<Permissions>;
|
28 | authenticated: false;
|
29 | cancellationReason: string;
|
30 | throughLobby: true;
|
31 | };
|
32 | export declare type Continuation = {
|
33 | scenario: Scenario.Continuation;
|
34 | permissions: Maybe<Permissions>;
|
35 | authenticated: true;
|
36 | newUser: false;
|
37 | throughLobby: false;
|
38 | username: string;
|
39 | fs?: FileSystem;
|
40 | };
|
41 |
|
42 |
|
43 |
|
44 | export declare enum InitialisationError {
|
45 | InsecureContext = "INSECURE_CONTEXT",
|
46 | UnsupportedBrowser = "UNSUPPORTED_BROWSER"
|
47 | }
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | export declare function initialise(options: {
|
56 | permissions?: Permissions;
|
57 | autoRemoveUrlParams?: boolean;
|
58 | loadFileSystem?: boolean;
|
59 | rootKey?: string;
|
60 | }): Promise<State>;
|
61 |
|
62 |
|
63 |
|
64 | export { initialise as initialize };
|
65 | export declare function isSupported(): Promise<boolean>;
|
66 | export * from './auth';
|
67 | export * from './filesystem';
|
68 | export * from './common/version';
|
69 | export declare const fs: typeof FileSystem;
|
70 | export * as apps from './apps/index';
|
71 | export * as dataRoot from './data-root';
|
72 | export * as did from './did/index';
|
73 | export * as errors from './errors';
|
74 | export * as lobby from './lobby/index';
|
75 | export * as path from './path';
|
76 | export * as setup from './setup';
|
77 | export * as ucan from './ucan/index';
|
78 | export * as dns from './dns/index';
|
79 | export * as ipfs from './ipfs/index';
|
80 | export * as keystore from './keystore';
|
81 | export * as machinery from './common/index';
|
82 | export * as crypto from './crypto/index';
|
83 | export * as cbor from 'cborg';
|