UNPKG

2.82 kBTypeScriptView Raw
1// Type definitions for gh-pages 3.2
2// Project: https://github.com/tschaub/gh-pages
3// Definitions by: Daniel Rosenwasser <https://github.com/DanielRosenwasser>
4// Piotr Błażejewicz <https://github.com/peterblazejewicz>
5// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6export interface Git {
7 exec: (command: string) => Promise<this>;
8 init: () => Promise<this>;
9 clean: () => Promise<this>;
10 reset: (remote: string, branch: string) => Promise<this>;
11 fetch: (remote: string) => Promise<this>;
12 checkout: (remote: string, branch: string) => Promise<this>;
13 rm: (files: string | string[]) => Promise<this>;
14 add: (files: string | string[]) => Promise<this>;
15 commit: (message: string) => Promise<this>;
16 tag: (name: string) => Promise<this>;
17 push: (remote: string, branch: string, force?: boolean) => Promise<this>;
18 getRemoteUrl: (remote: string) => Promise<this>;
19 deleteRef: (branch: string) => Promise<this>;
20 clone: (repo: string, dir: string, branch: string, options: PublishOptions) => Promise<this>;
21}
22export interface PublishOptions {
23 beforeAdd?: ((git: Git) => Promise<Git | undefined>) | null | undefined;
24 add?: boolean | undefined;
25 branch?: string | undefined;
26 dest?: string | undefined;
27 dotfiles?: boolean | undefined;
28 git?: string | undefined;
29 /**
30 * Push force new commit without parent history
31 * @default true
32 */
33 history?: boolean | undefined;
34 message?: string | undefined;
35 only?: string | undefined;
36 push?: boolean | undefined;
37 remote?: string | undefined;
38 /**
39 * Removes files that match the given pattern (Ignored if used together with --add).
40 * By default, gh-pages removes everything inside the target branch auto-generated directory before copying the new files from dir.
41 * @default '.'
42 */
43 remove?: string | undefined;
44 repo?: string | undefined;
45 silent?: boolean | undefined;
46 src?: string | string[] | undefined;
47 tag?: string | undefined;
48 user?:
49 | null
50 | {
51 name: string;
52 email: string;
53 }
54 | undefined;
55}
56
57/**
58 * Get the cache directory.
59 */
60export function getCacheDir(optPath?: string): string;
61export function publish(basePath: string, callback: (err: any) => void): void;
62export function publish(basePath: string, config: PublishOptions, callback?: (err: any) => void): void;
63
64export function clean(): void;
65
66export interface Defaults {
67 beforeAdd: null;
68 dest: '.';
69 add: false;
70 git: 'git';
71 depth: 1;
72 dotfiles: false;
73 branch: 'gh-pages';
74 remote: string;
75 src: '**/*';
76 remove: '.';
77 push: true;
78 history: true;
79 message: 'Updates';
80 silent: false;
81}
82
83export const defaults: Readonly<Defaults>;
84
\No newline at end of file