docviewhelper 0.0.1

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,24 @@
1
+ import { IFrameReloader, ViewerType } from './model';
2
+ export declare const fileToArray: (url: string) => Promise<ArrayBuffer>;
3
+ export declare const handleFileUpload: (fileInput: any) => Promise<string>;
4
+ export declare const getbaseUrl: () => string;
5
+ export declare const getLocation: (href: string) => {
6
+ href: string;
7
+ protocol: string;
8
+ host: string;
9
+ hostname: string;
10
+ port: string;
11
+ pathname: string;
12
+ search: string;
13
+ hash: string;
14
+ } | null;
15
+ export declare const getDocxToHtml: (url: string) => Promise<any>;
16
+ export declare const googleCheckSubscription: () => IFrameReloader;
17
+ export declare const iframeIsLoaded: (iframe: HTMLIFrameElement) => boolean;
18
+ export declare const getViewerDetails: (url: string, configuredViewer?: ViewerType, queryParams?: string, viewerUrl?: string) => {
19
+ url: string;
20
+ externalViewer: boolean;
21
+ };
22
+ export declare const replaceLocalUrl: (url: string, overrideLocalhost: string) => string;
23
+ export declare const uploadToCloud: (fileUrl: string, api: string) => Promise<unknown>;
24
+ export declare const isLocalFile: (file: string) => boolean;
package/lib/model.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ export declare type ViewerType = 'google' | 'office' | 'mammoth' | 'pdf' | 'url';
2
+ interface Props {
3
+ loaded?: () => void;
4
+ url: string;
5
+ queryParams?: string;
6
+ viewerUrl?: string;
7
+ googleCheckInterval?: number;
8
+ disableContent?: 'none' | 'all' | 'poput' | 'popout-hide';
9
+ googleCheckContentLoaded?: boolean;
10
+ viewer?: ViewerType;
11
+ }
12
+ export interface IFrameReloader {
13
+ subscribe: (iframe: HTMLIFrameElement, interval?: number, maxChecks?: number) => any;
14
+ unsubscribe: () => void;
15
+ }
16
+ export declare const defaultProps: Props;
17
+ export {};
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "docviewhelper",
3
+ "version": "0.0.1",
4
+ "license": "MIT",
5
+ "description": "Helper for ngx-doc-viewer and react-documents.",
6
+ "author": {
7
+ "name": "Marcel Hoekstra",
8
+ "email": "marcel.hoekstra@outlook.com",
9
+ "url": "https://github.com/Marcelh1983/"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/Marcelh1983/document-viewer.git"
14
+ },
15
+ "keywords": [
16
+ "ngx-doc-viewer",
17
+ "react-documents"
18
+ ],
19
+ "main": "./index.umd.js",
20
+ "types": "packages/react-documents/src/index.d.ts",
21
+ "bugs": {
22
+ "url": "https://github.com/Marcelh1983/document-viewer/issues"
23
+ },
24
+ "homepage": "https://github.com/Marcelh1983/document-viewer/tree/main/packages/docviewhelper",
25
+ "module": "./index.esm.js",
26
+ "typings": "./index.d.ts"
27
+ }