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.
Files changed (2) hide show
  1. package/index.d.ts +38 -29
  2. 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
- // Re-export variable validation types
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
- export interface ConfigoramaResult<T = any> {
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
- export interface ConfigContext<T = any> {
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
- export default configorama
108
-
109
- /** Configorama sync API */
110
- export function sync<T = any>(
111
- configPathOrObject: string | object,
112
- settings?: ConfigoramaSettings
113
- ): T
114
-
115
- /** Analyze config variables without resolving them */
116
- export function analyze(
117
- configPathOrObject: string | object,
118
- settings?: ConfigoramaSettings
119
- ): Promise<any>
120
-
121
- /** Format utilities for parsing various config formats */
122
- export const format: {
123
- yaml: any
124
- json: any
125
- toml: any
126
- ini: any
127
- hcl: any
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
- /** The Configorama class for advanced usage */
131
- export const Configorama: any
140
+ export = configorama
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "configorama",
3
- "version": "0.9.11",
3
+ "version": "0.9.12",
4
4
  "description": "Variable support for configuration files",
5
5
  "main": "src/index.js",
6
6
  "types": "index.d.ts",