@safeaccess/inline 0.1.1

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 (129) hide show
  1. package/.gitattributes +16 -0
  2. package/.gitkeep +0 -0
  3. package/CHANGELOG.md +38 -0
  4. package/LICENSE +21 -0
  5. package/README.md +454 -0
  6. package/benchmarks/get.bench.ts +26 -0
  7. package/benchmarks/parse.bench.ts +41 -0
  8. package/dist/accessors/abstract-accessor.d.ts +213 -0
  9. package/dist/accessors/abstract-accessor.js +294 -0
  10. package/dist/accessors/formats/any-accessor.d.ts +35 -0
  11. package/dist/accessors/formats/any-accessor.js +44 -0
  12. package/dist/accessors/formats/array-accessor.d.ts +26 -0
  13. package/dist/accessors/formats/array-accessor.js +39 -0
  14. package/dist/accessors/formats/env-accessor.d.ts +27 -0
  15. package/dist/accessors/formats/env-accessor.js +64 -0
  16. package/dist/accessors/formats/ini-accessor.d.ts +41 -0
  17. package/dist/accessors/formats/ini-accessor.js +109 -0
  18. package/dist/accessors/formats/json-accessor.d.ts +26 -0
  19. package/dist/accessors/formats/json-accessor.js +56 -0
  20. package/dist/accessors/formats/ndjson-accessor.d.ts +28 -0
  21. package/dist/accessors/formats/ndjson-accessor.js +71 -0
  22. package/dist/accessors/formats/object-accessor.d.ts +48 -0
  23. package/dist/accessors/formats/object-accessor.js +90 -0
  24. package/dist/accessors/formats/xml-accessor.d.ts +27 -0
  25. package/dist/accessors/formats/xml-accessor.js +52 -0
  26. package/dist/accessors/formats/yaml-accessor.d.ts +29 -0
  27. package/dist/accessors/formats/yaml-accessor.js +46 -0
  28. package/dist/contracts/accessors-interface.d.ts +11 -0
  29. package/dist/contracts/accessors-interface.js +1 -0
  30. package/dist/contracts/factory-accessors-interface.d.ts +16 -0
  31. package/dist/contracts/factory-accessors-interface.js +1 -0
  32. package/dist/contracts/parse-integration-interface.d.ts +31 -0
  33. package/dist/contracts/parse-integration-interface.js +1 -0
  34. package/dist/contracts/path-cache-interface.d.ts +40 -0
  35. package/dist/contracts/path-cache-interface.js +1 -0
  36. package/dist/contracts/readable-accessors-interface.d.ts +79 -0
  37. package/dist/contracts/readable-accessors-interface.js +1 -0
  38. package/dist/contracts/security-guard-interface.d.ts +40 -0
  39. package/dist/contracts/security-guard-interface.js +1 -0
  40. package/dist/contracts/security-parser-interface.d.ts +67 -0
  41. package/dist/contracts/security-parser-interface.js +1 -0
  42. package/dist/contracts/writable-accessors-interface.d.ts +65 -0
  43. package/dist/contracts/writable-accessors-interface.js +1 -0
  44. package/dist/core/dot-notation-parser.d.ts +204 -0
  45. package/dist/core/dot-notation-parser.js +343 -0
  46. package/dist/exceptions/accessor-exception.d.ts +13 -0
  47. package/dist/exceptions/accessor-exception.js +16 -0
  48. package/dist/exceptions/invalid-format-exception.d.ts +14 -0
  49. package/dist/exceptions/invalid-format-exception.js +17 -0
  50. package/dist/exceptions/parser-exception.d.ts +14 -0
  51. package/dist/exceptions/parser-exception.js +17 -0
  52. package/dist/exceptions/path-not-found-exception.d.ts +14 -0
  53. package/dist/exceptions/path-not-found-exception.js +17 -0
  54. package/dist/exceptions/readonly-violation-exception.d.ts +15 -0
  55. package/dist/exceptions/readonly-violation-exception.js +18 -0
  56. package/dist/exceptions/security-exception.d.ts +18 -0
  57. package/dist/exceptions/security-exception.js +21 -0
  58. package/dist/exceptions/unsupported-type-exception.d.ts +14 -0
  59. package/dist/exceptions/unsupported-type-exception.js +17 -0
  60. package/dist/exceptions/yaml-parse-exception.d.ts +17 -0
  61. package/dist/exceptions/yaml-parse-exception.js +20 -0
  62. package/dist/index.d.ts +30 -0
  63. package/dist/index.js +30 -0
  64. package/dist/inline.d.ts +402 -0
  65. package/dist/inline.js +512 -0
  66. package/dist/parser/xml-parser.d.ts +46 -0
  67. package/dist/parser/xml-parser.js +288 -0
  68. package/dist/parser/yaml-parser.d.ts +94 -0
  69. package/dist/parser/yaml-parser.js +286 -0
  70. package/dist/security/forbidden-keys.d.ts +34 -0
  71. package/dist/security/forbidden-keys.js +80 -0
  72. package/dist/security/security-guard.d.ts +94 -0
  73. package/dist/security/security-guard.js +172 -0
  74. package/dist/security/security-parser.d.ts +130 -0
  75. package/dist/security/security-parser.js +192 -0
  76. package/dist/type-format.d.ts +28 -0
  77. package/dist/type-format.js +29 -0
  78. package/eslint.config.js +1 -0
  79. package/package.json +39 -0
  80. package/src/accessors/abstract-accessor.ts +353 -0
  81. package/src/accessors/formats/any-accessor.ts +51 -0
  82. package/src/accessors/formats/array-accessor.ts +45 -0
  83. package/src/accessors/formats/env-accessor.ts +79 -0
  84. package/src/accessors/formats/ini-accessor.ts +124 -0
  85. package/src/accessors/formats/json-accessor.ts +66 -0
  86. package/src/accessors/formats/ndjson-accessor.ts +82 -0
  87. package/src/accessors/formats/object-accessor.ts +100 -0
  88. package/src/accessors/formats/xml-accessor.ts +58 -0
  89. package/src/accessors/formats/yaml-accessor.ts +52 -0
  90. package/src/contracts/accessors-interface.ts +12 -0
  91. package/src/contracts/factory-accessors-interface.ts +16 -0
  92. package/src/contracts/parse-integration-interface.ts +32 -0
  93. package/src/contracts/path-cache-interface.ts +43 -0
  94. package/src/contracts/readable-accessors-interface.ts +88 -0
  95. package/src/contracts/security-guard-interface.ts +43 -0
  96. package/src/contracts/security-parser-interface.ts +74 -0
  97. package/src/contracts/writable-accessors-interface.ts +70 -0
  98. package/src/core/dot-notation-parser.ts +419 -0
  99. package/src/exceptions/accessor-exception.ts +16 -0
  100. package/src/exceptions/invalid-format-exception.ts +18 -0
  101. package/src/exceptions/parser-exception.ts +18 -0
  102. package/src/exceptions/path-not-found-exception.ts +18 -0
  103. package/src/exceptions/readonly-violation-exception.ts +19 -0
  104. package/src/exceptions/security-exception.ts +22 -0
  105. package/src/exceptions/unsupported-type-exception.ts +18 -0
  106. package/src/exceptions/yaml-parse-exception.ts +21 -0
  107. package/src/index.ts +46 -0
  108. package/src/inline.ts +570 -0
  109. package/src/parser/xml-parser.ts +334 -0
  110. package/src/parser/yaml-parser.ts +368 -0
  111. package/src/security/forbidden-keys.ts +81 -0
  112. package/src/security/security-guard.ts +195 -0
  113. package/src/security/security-parser.ts +233 -0
  114. package/src/type-format.ts +28 -0
  115. package/stryker.config.json +24 -0
  116. package/tests/accessors/accessors.test.ts +1017 -0
  117. package/tests/accessors/json-accessor.test.ts +171 -0
  118. package/tests/core/dot-notation-parser.test.ts +587 -0
  119. package/tests/exceptions/parser-exception.test.ts +31 -0
  120. package/tests/inline.test.ts +445 -0
  121. package/tests/mocks/fake-parse-integration.ts +24 -0
  122. package/tests/mocks/fake-path-cache.ts +31 -0
  123. package/tests/parity.test.ts +164 -0
  124. package/tests/parser/xml-parser.test.ts +618 -0
  125. package/tests/parser/yaml-parser.test.ts +463 -0
  126. package/tests/security/security-guard.test.ts +646 -0
  127. package/tests/security/security-parser.test.ts +391 -0
  128. package/tsconfig.json +16 -0
  129. package/vitest.config.ts +19 -0
package/dist/index.js ADDED
@@ -0,0 +1,30 @@
1
+ // Main facade
2
+ export { Inline } from './inline.js';
3
+ // TypeFormat enum
4
+ export { TypeFormat } from './type-format.js';
5
+ // Accessor base
6
+ export { AbstractAccessor } from './accessors/abstract-accessor.js';
7
+ // Format accessors
8
+ export { ArrayAccessor } from './accessors/formats/array-accessor.js';
9
+ export { ObjectAccessor } from './accessors/formats/object-accessor.js';
10
+ export { JsonAccessor } from './accessors/formats/json-accessor.js';
11
+ export { XmlAccessor } from './accessors/formats/xml-accessor.js';
12
+ export { YamlAccessor } from './accessors/formats/yaml-accessor.js';
13
+ export { IniAccessor } from './accessors/formats/ini-accessor.js';
14
+ export { EnvAccessor } from './accessors/formats/env-accessor.js';
15
+ export { NdjsonAccessor } from './accessors/formats/ndjson-accessor.js';
16
+ export { AnyAccessor } from './accessors/formats/any-accessor.js';
17
+ // Core
18
+ // NOTE: DotNotationParser is intentionally not exported — it is an internal component.
19
+ // Security
20
+ export { SecurityGuard } from './security/security-guard.js';
21
+ export { SecurityParser } from './security/security-parser.js';
22
+ // Exceptions
23
+ export { AccessorException } from './exceptions/accessor-exception.js';
24
+ export { InvalidFormatException } from './exceptions/invalid-format-exception.js';
25
+ export { YamlParseException } from './exceptions/yaml-parse-exception.js';
26
+ export { ParserException } from './exceptions/parser-exception.js';
27
+ export { PathNotFoundException } from './exceptions/path-not-found-exception.js';
28
+ export { ReadonlyViolationException } from './exceptions/readonly-violation-exception.js';
29
+ export { SecurityException } from './exceptions/security-exception.js';
30
+ export { UnsupportedTypeException } from './exceptions/unsupported-type-exception.js';
@@ -0,0 +1,402 @@
1
+ import { TypeFormat } from './type-format.js';
2
+ import { DotNotationParser } from './core/dot-notation-parser.js';
3
+ import type { SecurityGuardInterface } from './contracts/security-guard-interface.js';
4
+ import type { SecurityParserInterface } from './contracts/security-parser-interface.js';
5
+ import type { AccessorsInterface } from './contracts/accessors-interface.js';
6
+ import type { ParseIntegrationInterface } from './contracts/parse-integration-interface.js';
7
+ import type { PathCacheInterface } from './contracts/path-cache-interface.js';
8
+ import { ArrayAccessor } from './accessors/formats/array-accessor.js';
9
+ import { ObjectAccessor } from './accessors/formats/object-accessor.js';
10
+ import { JsonAccessor } from './accessors/formats/json-accessor.js';
11
+ import { XmlAccessor } from './accessors/formats/xml-accessor.js';
12
+ import { YamlAccessor } from './accessors/formats/yaml-accessor.js';
13
+ import { IniAccessor } from './accessors/formats/ini-accessor.js';
14
+ import { EnvAccessor } from './accessors/formats/env-accessor.js';
15
+ import { NdjsonAccessor } from './accessors/formats/ndjson-accessor.js';
16
+ import { AnyAccessor } from './accessors/formats/any-accessor.js';
17
+ /**
18
+ * Facade for creating typed data accessors fluently.
19
+ *
20
+ * All static factory methods return a strongly-typed accessor instance.
21
+ * Use the builder methods (`withSecurityGuard`, `withSecurityParser`) to
22
+ * customize the security configuration before creating an accessor.
23
+ *
24
+ * @example
25
+ * const accessor = Inline.fromJson('{"name":"Alice"}');
26
+ * accessor.get('name'); // 'Alice'
27
+ *
28
+ * @example
29
+ * const accessor = Inline.from(TypeFormat.Yaml, 'name: Alice');
30
+ * accessor.get('name'); // 'Alice'
31
+ */
32
+ export declare class Inline {
33
+ private readonly guard;
34
+ private readonly secParser;
35
+ private readonly pathCache;
36
+ private readonly integration;
37
+ private readonly strictMode;
38
+ private constructor();
39
+ private static defaultInstance;
40
+ private makeParser;
41
+ /**
42
+ * Apply configured strict mode to a new accessor before hydration.
43
+ *
44
+ * @param accessor - Unhydrated accessor instance.
45
+ * @returns Same accessor with strict mode applied if configured.
46
+ */
47
+ private prepare;
48
+ /**
49
+ * Return a new Inline instance with a custom SecurityGuard, preserving other settings.
50
+ *
51
+ * @param guard - Custom security guard implementation.
52
+ * @returns New Inline builder instance.
53
+ */
54
+ withSecurityGuard(guard: SecurityGuardInterface): Inline;
55
+ /**
56
+ * Return a new Inline instance with a custom SecurityParser, preserving other settings.
57
+ *
58
+ * @param parser - Custom security parser implementation.
59
+ * @returns New Inline builder instance.
60
+ */
61
+ withSecurityParser(parser: SecurityParserInterface): Inline;
62
+ /**
63
+ * Return a new Inline instance with a custom path cache, preserving other settings.
64
+ *
65
+ * @param cache - Custom path cache implementation.
66
+ * @returns New Inline builder instance.
67
+ */
68
+ withPathCache(cache: PathCacheInterface): Inline;
69
+ /**
70
+ * Return a new Inline instance with a custom parser integration, preserving other settings.
71
+ *
72
+ * @param integration - Custom format integration implementation.
73
+ * @returns New Inline builder instance.
74
+ */
75
+ withParserIntegration(integration: ParseIntegrationInterface): Inline;
76
+ /**
77
+ * Return a new Inline instance with the given strict mode, preserving other settings.
78
+ *
79
+ * @param strict - Whether to enable strict security validation.
80
+ * @returns New Inline builder instance.
81
+ *
82
+ * @security Passing `false` disables all SecurityGuard and SecurityParser
83
+ * validation. Only use with fully trusted, application-controlled input.
84
+ */
85
+ withStrictMode(strict: boolean): Inline;
86
+ /**
87
+ * Return a new Inline instance with a custom SecurityGuard.
88
+ *
89
+ * @param guard - Custom security guard implementation.
90
+ * @returns New Inline builder instance.
91
+ *
92
+ * @example
93
+ * Inline.withSecurityGuard(new SecurityGuard(10, ['extraKey'])).fromJson('{}');
94
+ */
95
+ static withSecurityGuard(guard: SecurityGuardInterface): Inline;
96
+ /**
97
+ * Return a new Inline instance with a custom SecurityParser.
98
+ *
99
+ * @param parser - Custom security parser implementation.
100
+ * @returns New Inline builder instance.
101
+ *
102
+ * @example
103
+ * Inline.withSecurityParser(new SecurityParser({ maxDepth: 10 })).fromJson('{}');
104
+ */
105
+ static withSecurityParser(parser: SecurityParserInterface): Inline;
106
+ /**
107
+ * Return a new Inline instance with a custom path cache.
108
+ *
109
+ * @param cache - Custom path cache implementation.
110
+ * @returns New Inline builder instance.
111
+ *
112
+ * @example
113
+ * const cache: PathCacheInterface = { get: () => null, set: () => {}, has: () => false, clear: () => {} };
114
+ * Inline.withPathCache(cache).fromJson('{"key":"value"}');
115
+ */
116
+ static withPathCache(cache: PathCacheInterface): Inline;
117
+ /**
118
+ * Return a new Inline instance with a custom parser integration for `fromAny()`.
119
+ *
120
+ * @param integration - Custom format integration implementation.
121
+ * @returns New Inline builder instance.
122
+ *
123
+ * @example
124
+ * Inline.withParserIntegration(new MyCsvIntegration()).fromAny(csvString);
125
+ */
126
+ static withParserIntegration(integration: ParseIntegrationInterface): Inline;
127
+ /**
128
+ * Return a new Inline instance with the given strict mode.
129
+ *
130
+ * @param strict - Whether to enable strict security validation.
131
+ * @returns New Inline builder instance.
132
+ *
133
+ * @security Passing `false` disables all SecurityGuard and SecurityParser
134
+ * validation. Only use with fully trusted, application-controlled input.
135
+ *
136
+ * @example
137
+ * Inline.withStrictMode(false).fromJson(hugePayload).get('key');
138
+ */
139
+ static withStrictMode(strict: boolean): Inline;
140
+ /**
141
+ * Create an ArrayAccessor from a plain object or array.
142
+ *
143
+ * @param data - Plain object or array input.
144
+ * @returns Populated ArrayAccessor instance.
145
+ * @throws {SecurityException} When security constraints are violated.
146
+ *
147
+ * @example
148
+ * inline.fromArray({ name: 'Alice' }).get('name'); // 'Alice'
149
+ */
150
+ fromArray(data: Record<string, unknown> | unknown[]): ArrayAccessor;
151
+ /**
152
+ * Create an ObjectAccessor from a JavaScript object.
153
+ *
154
+ * @param data - Object input (plain object, class instance, etc.).
155
+ * @returns Populated ObjectAccessor instance.
156
+ * @throws {SecurityException} When security constraints are violated.
157
+ *
158
+ * @example
159
+ * inline.fromObject({ user: { name: 'Alice' } }).get('user.name');
160
+ */
161
+ fromObject(data: object): ObjectAccessor;
162
+ /**
163
+ * Create a JsonAccessor from a JSON string.
164
+ *
165
+ * @param data - Raw JSON string.
166
+ * @returns Populated JsonAccessor instance.
167
+ * @throws {InvalidFormatException} When the JSON is malformed.
168
+ * @throws {SecurityException} When security constraints are violated.
169
+ *
170
+ * @example
171
+ * inline.fromJson('{"key":"value"}').get('key'); // 'value'
172
+ */
173
+ fromJson(data: string): JsonAccessor;
174
+ /**
175
+ * Create an XmlAccessor from an XML string.
176
+ *
177
+ * @param data - Raw XML string.
178
+ * @returns Populated XmlAccessor instance.
179
+ * @throws {InvalidFormatException} When the XML is malformed.
180
+ * @throws {SecurityException} When DOCTYPE is detected.
181
+ *
182
+ * @example
183
+ * inline.fromXml('<root><key>value</key></root>').get('key');
184
+ */
185
+ fromXml(data: string): XmlAccessor;
186
+ /**
187
+ * Create a YamlAccessor from a YAML string.
188
+ *
189
+ * @param data - Raw YAML string.
190
+ * @returns Populated YamlAccessor instance.
191
+ * @throws {YamlParseException} When the YAML is malformed or contains unsafe constructs.
192
+ * @throws {SecurityException} When security constraints are violated.
193
+ *
194
+ * @example
195
+ * inline.fromYaml('name: Alice').get('name'); // 'Alice'
196
+ */
197
+ fromYaml(data: string): YamlAccessor;
198
+ /**
199
+ * Create an IniAccessor from an INI string.
200
+ *
201
+ * @param data - Raw INI string.
202
+ * @returns Populated IniAccessor instance.
203
+ * @throws {InvalidFormatException} When the input is not a string.
204
+ * @throws {SecurityException} When security constraints are violated.
205
+ *
206
+ * @example
207
+ * inline.fromIni('[section]\nkey=value').get('section.key'); // 'value'
208
+ */
209
+ fromIni(data: string): IniAccessor;
210
+ /**
211
+ * Create an EnvAccessor from a dotenv-formatted string.
212
+ *
213
+ * @param data - Raw dotenv string.
214
+ * @returns Populated EnvAccessor instance.
215
+ * @throws {SecurityException} When security constraints are violated.
216
+ *
217
+ * @example
218
+ * inline.fromEnv('APP_NAME=MyApp').get('APP_NAME'); // 'MyApp'
219
+ */
220
+ fromEnv(data: string): EnvAccessor;
221
+ /**
222
+ * Create an NdjsonAccessor from a newline-delimited JSON string.
223
+ *
224
+ * @param data - Raw NDJSON string.
225
+ * @returns Populated NdjsonAccessor instance.
226
+ * @throws {InvalidFormatException} When any JSON line is malformed.
227
+ * @throws {SecurityException} When security constraints are violated.
228
+ *
229
+ * @example
230
+ * inline.fromNdjson('{"id":1}\n{"id":2}').get('0.id'); // 1
231
+ */
232
+ fromNdjson(data: string): NdjsonAccessor;
233
+ /**
234
+ * Create an AnyAccessor from raw data using a custom integration.
235
+ *
236
+ * Uses the integration provided via `withParserIntegration()` by default,
237
+ * or the one passed as the second argument for a one-off override.
238
+ *
239
+ * @param data - Raw input data in any format supported by the integration.
240
+ * @param integration - Override integration for this call (optional).
241
+ * @returns Populated AnyAccessor instance.
242
+ * @throws {InvalidFormatException} When no integration is available or it rejects the format.
243
+ * @throws {SecurityException} When security constraints are violated.
244
+ *
245
+ * @example
246
+ * Inline.withParserIntegration(new CsvIntegration()).fromAny(csvString);
247
+ */
248
+ fromAny(data: unknown, integration?: ParseIntegrationInterface): AnyAccessor;
249
+ /**
250
+ * Create a typed accessor by its constructor.
251
+ *
252
+ * @param AccessorConstructor - The accessor class to instantiate.
253
+ * @param data - Raw data to hydrate the accessor with.
254
+ * @returns Populated accessor instance.
255
+ *
256
+ * @example
257
+ * Inline.make(JsonAccessor, '{"key":"value"}').get('key'); // 'value'
258
+ */
259
+ make<T extends AccessorsInterface>(AccessorConstructor: new (parser: DotNotationParser) => T, data: unknown): T;
260
+ /**
261
+ * Create an accessor for the given TypeFormat and raw data.
262
+ *
263
+ * @param typeFormat - The format to parse as.
264
+ * @param data - Raw input data.
265
+ * @returns Populated accessor instance.
266
+ * @throws {InvalidFormatException} When the data is malformed for the target format.
267
+ * @throws {SecurityException} When security constraints are violated.
268
+ * @throws {UnsupportedTypeException} When the TypeFormat is not supported.
269
+ */
270
+ from(typeFormat: TypeFormat, data: unknown): AccessorsInterface;
271
+ /**
272
+ * Create an ArrayAccessor from a plain object or array.
273
+ *
274
+ * @param data - Plain object or array input.
275
+ * @returns Populated ArrayAccessor instance.
276
+ * @throws {SecurityException} When security constraints are violated.
277
+ *
278
+ * @example
279
+ * Inline.fromArray({ name: 'Alice' }).get('name'); // 'Alice'
280
+ */
281
+ static fromArray(data: Record<string, unknown> | unknown[]): ArrayAccessor;
282
+ /**
283
+ * Create an ObjectAccessor from a JavaScript object.
284
+ *
285
+ * @param data - Object input (plain object, class instance, etc.).
286
+ * @returns Populated ObjectAccessor instance.
287
+ * @throws {SecurityException} When security constraints are violated.
288
+ *
289
+ * @example
290
+ * Inline.fromObject({ user: { name: 'Alice' } }).get('user.name');
291
+ */
292
+ static fromObject(data: object): ObjectAccessor;
293
+ /**
294
+ * Create a JsonAccessor from a JSON string.
295
+ *
296
+ * @param data - Raw JSON string.
297
+ * @returns Populated JsonAccessor instance.
298
+ * @throws {InvalidFormatException} When the JSON is malformed.
299
+ * @throws {SecurityException} When security constraints are violated.
300
+ *
301
+ * @example
302
+ * Inline.fromJson('{"key":"value"}').get('key'); // 'value'
303
+ */
304
+ static fromJson(data: string): JsonAccessor;
305
+ /**
306
+ * Create an XmlAccessor from an XML string.
307
+ *
308
+ * @param data - Raw XML string.
309
+ * @returns Populated XmlAccessor instance.
310
+ * @throws {InvalidFormatException} When the XML is malformed.
311
+ * @throws {SecurityException} When DOCTYPE is detected.
312
+ *
313
+ * @example
314
+ * Inline.fromXml('<root><key>value</key></root>').get('key');
315
+ */
316
+ static fromXml(data: string): XmlAccessor;
317
+ /**
318
+ * Create a YamlAccessor from a YAML string.
319
+ *
320
+ * @param data - Raw YAML string.
321
+ * @returns Populated YamlAccessor instance.
322
+ * @throws {YamlParseException} When the YAML is malformed or contains unsafe constructs.
323
+ * @throws {SecurityException} When security constraints are violated.
324
+ *
325
+ * @example
326
+ * Inline.fromYaml('name: Alice\nage: 30').get('name'); // 'Alice'
327
+ */
328
+ static fromYaml(data: string): YamlAccessor;
329
+ /**
330
+ * Create an IniAccessor from an INI string.
331
+ *
332
+ * @param data - Raw INI string.
333
+ * @returns Populated IniAccessor instance.
334
+ * @throws {InvalidFormatException} When the input is not a string.
335
+ * @throws {SecurityException} When security constraints are violated.
336
+ *
337
+ * @example
338
+ * Inline.fromIni('[section]\nkey=value').get('section.key'); // 'value'
339
+ */
340
+ static fromIni(data: string): IniAccessor;
341
+ /**
342
+ * Create an EnvAccessor from a dotenv-formatted string.
343
+ *
344
+ * @param data - Raw dotenv string.
345
+ * @returns Populated EnvAccessor instance.
346
+ * @throws {SecurityException} When security constraints are violated.
347
+ *
348
+ * @example
349
+ * Inline.fromEnv('APP_NAME=MyApp\nDEBUG=true').get('APP_NAME'); // 'MyApp'
350
+ */
351
+ static fromEnv(data: string): EnvAccessor;
352
+ /**
353
+ * Create an NdjsonAccessor from a newline-delimited JSON string.
354
+ *
355
+ * @param data - Raw NDJSON string.
356
+ * @returns Populated NdjsonAccessor instance.
357
+ * @throws {InvalidFormatException} When any JSON line is malformed.
358
+ * @throws {SecurityException} When security constraints are violated.
359
+ *
360
+ * @example
361
+ * Inline.fromNdjson('{"id":1}\n{"id":2}').get('0.id'); // 1
362
+ */
363
+ static fromNdjson(data: string): NdjsonAccessor;
364
+ /**
365
+ * Create an accessor for the given TypeFormat and raw data.
366
+ *
367
+ * @param typeFormat - The format to parse as.
368
+ * @param data - Raw input data.
369
+ * @returns Populated accessor instance.
370
+ * @throws {InvalidFormatException} When the data is malformed for the target format.
371
+ * @throws {SecurityException} When security constraints are violated.
372
+ * @throws {UnsupportedTypeException} When the TypeFormat is not supported.
373
+ *
374
+ * @example
375
+ * Inline.from(TypeFormat.Json, '{"key":"value"}').get('key'); // 'value'
376
+ */
377
+ static from(typeFormat: TypeFormat, data: unknown): AccessorsInterface;
378
+ /**
379
+ * Create an AnyAccessor from raw data using a custom integration.
380
+ *
381
+ * @param data - Raw input data.
382
+ * @param integration - Integration that detects and parses the format (optional if set via `withParserIntegration`).
383
+ * @returns Populated AnyAccessor instance.
384
+ * @throws {InvalidFormatException} When no integration is available or it rejects the format.
385
+ * @throws {SecurityException} When security constraints are violated.
386
+ *
387
+ * @example
388
+ * Inline.fromAny(csvString, new CsvIntegration()).get('0.name');
389
+ */
390
+ static fromAny(data: unknown, integration?: ParseIntegrationInterface): AnyAccessor;
391
+ /**
392
+ * Create a typed accessor by its constructor.
393
+ *
394
+ * @param AccessorConstructor - The accessor class to instantiate.
395
+ * @param data - Raw data to hydrate the accessor with.
396
+ * @returns Populated accessor instance.
397
+ *
398
+ * @example
399
+ * Inline.make(JsonAccessor, '{"key":"value"}').get('key'); // 'value'
400
+ */
401
+ static make<T extends AccessorsInterface>(AccessorConstructor: new (parser: DotNotationParser) => T, data: unknown): T;
402
+ }