configorama 0.9.11 → 0.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +38 -29
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
// Type definitions for configorama
|
|
2
2
|
// Project: https://github.com/DavidWells/configorama
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
export * from './src/types'
|
|
6
|
-
|
|
7
|
-
export interface ConfigoramaSettings {
|
|
4
|
+
interface ConfigoramaSettings {
|
|
8
5
|
/** Options to populate for ${opt:xyz}. These could be CLI flags */
|
|
9
6
|
options?: Record<string, any>
|
|
10
7
|
/** Regex of variable syntax */
|
|
@@ -64,7 +61,7 @@ export interface ConfigoramaSettings {
|
|
|
64
61
|
filePathOverrides?: Record<string, string>
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
|
|
64
|
+
interface ConfigoramaResult<T = any> {
|
|
68
65
|
/** The variable syntax pattern used */
|
|
69
66
|
variableSyntax: RegExp
|
|
70
67
|
/** Map of variable types found */
|
|
@@ -83,7 +80,7 @@ export interface ConfigoramaResult<T = any> {
|
|
|
83
80
|
* Context passed to JS/TS/ESM config file functions
|
|
84
81
|
* Used when config files export a function: `export default function(ctx) { ... }`
|
|
85
82
|
*/
|
|
86
|
-
|
|
83
|
+
interface ConfigContext<T = any> {
|
|
87
84
|
/** The original unresolved configuration object */
|
|
88
85
|
originalConfig: T
|
|
89
86
|
/** The current (partially resolved) configuration object */
|
|
@@ -104,28 +101,40 @@ declare function configorama<T = any>(
|
|
|
104
101
|
settings: ConfigoramaSettings & { returnMetadata: true }
|
|
105
102
|
): Promise<ConfigoramaResult<T>>
|
|
106
103
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
104
|
+
declare namespace configorama {
|
|
105
|
+
// Re-export types for consumers
|
|
106
|
+
export { ConfigoramaSettings, ConfigoramaResult, ConfigContext }
|
|
107
|
+
|
|
108
|
+
/** Configorama sync API */
|
|
109
|
+
export function sync<T = any>(
|
|
110
|
+
configPathOrObject: string | object,
|
|
111
|
+
settings?: ConfigoramaSettings
|
|
112
|
+
): T
|
|
113
|
+
|
|
114
|
+
/** Analyze config variables without resolving them */
|
|
115
|
+
export function analyze(
|
|
116
|
+
configPathOrObject: string | object,
|
|
117
|
+
settings?: ConfigoramaSettings
|
|
118
|
+
): Promise<any>
|
|
119
|
+
|
|
120
|
+
/** Format utilities for parsing various config formats */
|
|
121
|
+
export const format: {
|
|
122
|
+
yaml: any
|
|
123
|
+
json: any
|
|
124
|
+
toml: any
|
|
125
|
+
ini: any
|
|
126
|
+
hcl: any
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** The Configorama class for advanced usage */
|
|
130
|
+
export const Configorama: any
|
|
131
|
+
|
|
132
|
+
/** Build variable syntax regex */
|
|
133
|
+
export function buildVariableSyntax(
|
|
134
|
+
prefix?: string,
|
|
135
|
+
suffix?: string,
|
|
136
|
+
excludePatterns?: string[]
|
|
137
|
+
): string
|
|
128
138
|
}
|
|
129
139
|
|
|
130
|
-
|
|
131
|
-
export const Configorama: any
|
|
140
|
+
export = configorama
|