-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrootpath.d.ts
More file actions
37 lines (28 loc) · 811 Bytes
/
rootpath.d.ts
File metadata and controls
37 lines (28 loc) · 811 Bytes
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
// TODO: type naming overhaul
declare namespace Rootpath
{
export type Rootpath$Segment = (string | $Rootpath)
export type Rootpath$Path = (Rootpath$Segment | Rootpath$Path[])
export interface Rootpath$Resolver
{
(...args: Rootpath$Path[]): string,
}
export interface Rootpath$Constructor
{
new (...args: Rootpath$Path[]): $Rootpath,
(...args: Rootpath$Path[]): $Rootpath
}
export interface $Rootpath extends Rootpath$Resolver
{
path: string,
resolve: Rootpath$Resolver,
relative (to: Rootpath$Segment): string,
partial: Rootpath$Constructor,
contains (it: Rootpath$Segment): boolean,
guard (inside: Rootpath$Segment, fn_error?: Function): void,
over (each: Iterable<Rootpath$Path>): string[],
toString (): string,
}
}
declare const Rootpath: Rootpath.Rootpath$Constructor
export = Rootpath