1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type FS from 'fs';
|
8 | import type Path from 'path';
|
9 |
|
10 | import type {ScreenRecorder} from './node/ScreenRecorder.js';
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export const isNode = !!(typeof process !== 'undefined' && process.version);
|
16 |
|
17 | export interface EnvironmentDependencies {
|
18 | fs: typeof FS;
|
19 | path?: typeof Path;
|
20 | ScreenRecorder: typeof ScreenRecorder;
|
21 | }
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | export const environment: {
|
28 | value: EnvironmentDependencies;
|
29 | } = {
|
30 | value: {
|
31 | get fs(): typeof FS {
|
32 | throw new Error('fs is not available in this environment');
|
33 | },
|
34 | get ScreenRecorder(): typeof ScreenRecorder {
|
35 | throw new Error('ScreenRecorder is not available in this environment');
|
36 | },
|
37 | },
|
38 | };
|