UNPKG

2.46 kBTypeScriptView Raw
1declare module 'bower' {
2
3 // This really should be in module 'bower-config', but we don't directly
4 // import it yet.
5 export interface Config {
6 color?: boolean;
7 cwd?: string;
8 directory?: string;
9 interactive?: boolean;
10 save?: boolean;
11 offline?: boolean;
12 }
13
14 export const commands: {
15 install(packages: string[], installOptions: {}, config: Config):
16 NodeJS.EventEmitter;
17 list(readOptions: {}, config: Config): NodeJS.EventEmitter;
18 };
19
20 export const config: Config;
21
22 export type LogData = Warning|Conflict;
23
24 export interface Warning {
25 level: 'warn';
26 id: string;
27 message: string;
28 // data: any;
29 }
30 export interface Conflict {
31 level: 'conflict';
32 id: 'incompatible'|string;
33 message: string;
34 data: {
35 // Name of package with conflict
36 name: string; picks: Pick[];
37 }
38 }
39
40 export interface Pick {
41 /** This is the package request. */
42 endpoint: {
43 name: string;
44 /** repo */
45 source: string;
46 /** version name */
47 target: string;
48 };
49 /** local path to temporary dir on filesystem */
50 canonicalDir: string;
51 /** This is the bower.json of the package that was resolved */
52 pkgMeta: {
53 name: string; version: string;
54
55 // lot of stuff here we don't care about...
56 /*
57 main: [Object];
58 license: string;
59 ignore: [Object];
60 authors: [Object];
61 repository: [Object],
62 dependencies: [Object],
63 devDependencies: [Object],
64 private: true,
65 homepage: 'https://github.com/Polymer/polymer',
66 _release: '1.7.0',
67 _resolution: [Object],
68 _source: 'https://github.com/Polymer/polymer.git',
69 _target: '>=1.0.8'
70 */
71 },
72 }
73}
74
75declare module 'bower/lib/config' {
76 import {Config} from 'bower';
77 const defaultConfig: (config: any) => Config;
78 export = defaultConfig;
79}
80
81declare module 'bower/lib/renderers/StandardRenderer' {
82 import {Config, LogData} from 'bower';
83 class StandardRenderer {
84 constructor(command: string, config: Config);
85 log(data: LogData): void;
86 end(data: any): void;
87 error(error: Error): void;
88 }
89 export = StandardRenderer;
90}
91
92declare module 'bower/lib/core/Project' {
93 import {Config} from 'bower';
94 import Logger = require('bower-logger');
95 class Project {
96 constructor(config: Config, logger: Logger);
97 install(endpoints: string[], options: any, config: Config): void;
98 }
99 export = Project;
100}