-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.d.ts
73 lines (66 loc) · 2.23 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/** The data returned by `jupyter --paths --json` */
export interface JupyterPaths {
/** Paths: all the Jupyter Data Dirs */
data: Array<string>
/** RuntimeDir */
runtime: Array<string>
config: Array<string>
}
/** Ask Jupyter where the paths are using `jupyter --paths --json` */
export declare function askJupyter(): Promise<JupyterPaths>
interface Options {
/** Ask Jupyter where the paths are */
askJupyter: boolean
/** Include the sys.prefix paths When {options.withSysPrefix} is set, `dataDirs` returns a promise of directories */
withSysPrefix: boolean
}
/**
* DataDirs returns all the expected static directories for this OS. The user of this function should make sure to make
* sure the directories exist.
*
* @example
*
* ```js
* > jp.dataDirs()
* [ '/Users/rgbkrk/Library/Jupyter',
* '/usr/share/jupyter',
* '/usr/local/share/jupyter' ]
* ```
*
* When {options.withSysPrefix} is set, this returns a promise of directories
*
* If you want the paths to include the `sys.prefix` paths (for Anaconda installs), an optional `opts` parameter is
* accepted with key `withSysPrefix`. This changes the return to a promise for you instead.
*
* @example
*
* ```js
* jp.dataDirs({ withSysPrefix: true }).then(console.log)
* ```
*
* Promise { <pending> } [ '/Users/rgbkrk/Library/Jupyter',
* '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/share/jupyter', '/usr/share/jupyter',
* '/usr/local/share/jupyter' ]
*
* @returns All the Jupyter Data Dirs
*/
export declare function dataDirs(options?: Options): Promise<Array<string>>
/**
* Returns immediately with the path to running kernels
*
* @example Jp.runtimeDir() //-> '/Users/rgbkrk/Library/Jupyter/runtime'
*/
export declare function runtimeDir(): string
/**
* Like `dataDirs`, an optional `options` parameter is accepted with key `withSysPrefix` as an argument.
*
* ```JavaScript
* > jp.configDirs({ withSysPrefix: true }).then(console.log)
* Promise { <pending> }
* > [ '/Users/rgbkrk/.jupyter',
* '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/etc/jupyter',
* '/usr/local/etc/jupyter',
* '/etc/jupyter' ]
* ```
*/
export declare function configDirs(options?: Options): Promise<Array<string>>