DataSpecProxy
DataSpecProxy<
T> =SpecBuilderMethods&TextendsRecord<string,unknown> ?{ [K in keyof T & string]: DataSpecProxy<T[K]> }:unknown
Defined in: extract/data-spec-builder.ts:84
A Proxy-based spec builder that provides typed direct property access.
For a data type T, each key K of T becomes a navigable property
that returns another DataSpecProxy for the nested type. All SpecBuilder
methods (string(), number(), get(), etc.) are also available.
SpecBuilder methods take priority over data property names. If your data
has a key named string or number, use $.get('string') instead.
Type Parameters
Section titled “Type Parameters”T
The data shape being navigated
Example
Section titled “Example”// With load({ name: 'Alice', age: 30, address: { city: 'NYC' } })// $ is DataSpecProxy<{ name: string, age: number, address: { city: string } }>
$.name.string() // equivalent to $.get('name').string()$.age.number() // equivalent to $.get('age').number()$.address.city.string() // equivalent to $.get('address').get('city').string()