1 |
|
2 | import * as events from 'events';
|
3 | import { INilCallback } from 'util.toolbox';
|
4 | export interface IPatternOpts {
|
5 | columns?: number;
|
6 | chevrons?: string[];
|
7 | repeat?: number;
|
8 | }
|
9 | export interface IFixtureOpts {
|
10 | basedir?: string;
|
11 | dataFile?: string;
|
12 | fixtureDirectory?: string;
|
13 | jsonFile?: string;
|
14 | script?: string;
|
15 | templateData?: {
|
16 | [name: string]: string;
|
17 | };
|
18 | loremIpsum?: any;
|
19 | pattern?: IPatternOpts;
|
20 | }
|
21 | export interface IFixtureCallback extends INilCallback {
|
22 | (err: Error | null, directories: string[] | any): void | null;
|
23 | }
|
24 |
|
25 | export declare class Fixture extends events.EventEmitter {
|
26 | |
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | static cleanup(cb?: IFixtureCallback): void;
|
40 | private _basedir;
|
41 | private _dir;
|
42 | private _data;
|
43 | private _files;
|
44 | private _loremIpsum;
|
45 | private _name;
|
46 | private _obj;
|
47 | private _opts;
|
48 | private _pattern;
|
49 | private _src;
|
50 | |
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | constructor(name?: string, opts?: IFixtureOpts);
|
58 | /**
|
59 | * Generates a test pattern string. The generated string is created from a
|
60 | * list of chevrons. Each chevron is a full row of N columns. The default
|
61 | * string is 26 rows with 80 columns, where each default chevron is A-Z
|
62 | */
|
63 | private patternGenerator;
|
64 | /**
|
65 | * Takes a file name within the fixture, and reads the contents of the
|
66 | * file into a buffer and returns it. This is the name of the relative path
|
67 | * and file within the fixture.
|
68 | * @param filename {string} the name of the file within the fixture to read.
|
69 | * @returns a string representing the contents of the requested file.
|
70 | */
|
71 | read(filename: string): string;
|
72 | |
73 |
|
74 |
|
75 |
|
76 |
|
77 | setBaseDirectory(): string;
|
78 | |
79 |
|
80 |
|
81 |
|
82 |
|
83 | toString(): string;
|
84 | basedir: string;
|
85 | readonly data: string[];
|
86 | readonly dir: string;
|
87 | readonly files: string[];
|
88 | readonly loremIpsum: string;
|
89 | readonly name: string;
|
90 | readonly obj: any;
|
91 | readonly pattern: string;
|
92 | readonly src: string;
|
93 | }
|