@useparagon/connect 1.0.36 → 1.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,77 @@
1
+ import ConnectSDK from '../../ConnectSDK';
2
+ import { FilePickerInitOptions, FilePickerOptions, FilePickerStatus } from '../../types';
3
+ import { BaseFilePicker } from '../types/baseFilePicker';
4
+ export interface BoxPickerInstance {
5
+ addListener: (event: BoxPickerEvent, handler: BoxPickerEventHandler) => void;
6
+ removeAllListeners: () => void;
7
+ show: (folderId: string, accessToken: string, options: BoxPickerOptions) => void;
8
+ }
9
+ export type BoxPickerEvent = 'choose' | 'cancel' | 'close';
10
+ export type BoxPickerEventHandler = (items?: BoxPickerItem[]) => void;
11
+ export interface BoxPickerItem {
12
+ id: string;
13
+ name: string;
14
+ type: 'file' | 'folder';
15
+ size?: number;
16
+ extension?: string;
17
+ modified_at?: string;
18
+ description?: string;
19
+ path_collection?: {
20
+ entries: Array<{
21
+ id: string;
22
+ name: string;
23
+ type: string;
24
+ }>;
25
+ };
26
+ shared_link?: {
27
+ url: string;
28
+ download_url?: string;
29
+ permissions?: {
30
+ can_download?: boolean;
31
+ can_preview?: boolean;
32
+ };
33
+ };
34
+ }
35
+ export interface BoxPickerOptions {
36
+ container?: string;
37
+ maxSelectable?: number;
38
+ canUpload?: boolean;
39
+ canCreateNewFolder?: boolean;
40
+ canSetShareAccess?: boolean;
41
+ canDownload?: boolean;
42
+ canDelete?: boolean;
43
+ canRename?: boolean;
44
+ canPreview?: boolean;
45
+ canComment?: boolean;
46
+ canShare?: boolean;
47
+ canMove?: boolean;
48
+ canCopy?: boolean;
49
+ extensions?: string[];
50
+ canSelectFolder?: boolean;
51
+ }
52
+ export interface BoxConfig {
53
+ version: string;
54
+ scriptUrl: string;
55
+ cssUrl: string;
56
+ containerClass: string;
57
+ containerStyles: Partial<CSSStyleDeclaration>;
58
+ iframeStyles: Partial<CSSStyleDeclaration>;
59
+ pickerOptions: BoxPickerOptions;
60
+ }
61
+ export declare class BoxFilePicker extends BaseFilePicker {
62
+ private config;
63
+ dependencyStatus: FilePickerStatus;
64
+ accessToken: string;
65
+ protected instance: BoxPickerInstance | undefined;
66
+ constructor(options: FilePickerOptions, connectSDKInstance: ConnectSDK, config?: Partial<BoxConfig>);
67
+ getInstance(): BoxPickerInstance;
68
+ private setupEventListeners;
69
+ private cleanup;
70
+ private createPickerContainer;
71
+ private injectCSS;
72
+ open(): boolean;
73
+ init(options: FilePickerInitOptions): Promise<boolean>;
74
+ launch(): Promise<void>;
75
+ protected onScriptLoaded(): void;
76
+ protected onScriptError(): void;
77
+ }
@@ -1,7 +1,9 @@
1
+ import { BoxFilePicker } from './box';
1
2
  import { GoogleDriveFilePicker } from './googledrive';
2
3
  import { OneDriveFilePicker } from './onedrive';
3
4
  import { SharepointFilePicker } from './sharepoint';
4
5
  declare const _default: {
6
+ BoxFilePicker: typeof BoxFilePicker;
5
7
  GoogleDriveFilePicker: typeof GoogleDriveFilePicker;
6
8
  OneDriveFilePicker: typeof OneDriveFilePicker;
7
9
  SharepointFilePicker: typeof SharepointFilePicker;