shelving 1.248.0 → 1.249.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.
- package/api/provider/ClientAPIProvider.d.ts +0 -1
- package/api/provider/ClientAPIProvider.js +0 -1
- package/db/collection/Collection.d.ts +0 -1
- package/db/collection/Collection.js +0 -1
- package/error/Errors.d.ts +0 -1
- package/error/Errors.js +0 -1
- package/error/NetworkError.d.ts +0 -1
- package/error/NetworkError.js +0 -1
- package/error/RequiredError.d.ts +0 -1
- package/error/RequiredError.js +0 -1
- package/error/UnexpectedError.d.ts +0 -1
- package/error/UnexpectedError.js +0 -1
- package/error/UnimplementedError.d.ts +0 -1
- package/error/UnimplementedError.js +0 -1
- package/error/ValueError.d.ts +0 -1
- package/error/ValueError.js +0 -1
- package/extract/DirectoryExtractor.d.ts +0 -2
- package/extract/DirectoryExtractor.js +0 -2
- package/extract/IndexExtractor.d.ts +0 -1
- package/extract/IndexExtractor.js +0 -1
- package/extract/MergingExtractor.d.ts +0 -1
- package/extract/MergingExtractor.js +0 -1
- package/extract/PackageExtractor.d.ts +0 -2
- package/extract/PackageExtractor.js +0 -2
- package/extract/TypescriptExtractor.d.ts +2 -1
- package/extract/TypescriptExtractor.js +44 -17
- package/markup/MarkupParser.d.ts +0 -2
- package/markup/MarkupParser.js +0 -2
- package/package.json +1 -1
- package/schema/AddressSchema.d.ts +7 -6
- package/schema/AddressSchema.js +0 -4
- package/schema/ArraySchema.d.ts +21 -14
- package/schema/ArraySchema.js +0 -3
- package/schema/BooleanSchema.d.ts +8 -7
- package/schema/BooleanSchema.js +0 -4
- package/schema/ChoiceSchema.d.ts +1 -4
- package/schema/ChoiceSchema.js +0 -3
- package/schema/ColorSchema.d.ts +22 -9
- package/schema/ColorSchema.js +0 -7
- package/schema/CountrySchema.d.ts +0 -1
- package/schema/CountrySchema.js +0 -1
- package/schema/CurrencyAmountSchema.d.ts +2 -6
- package/schema/CurrencyAmountSchema.js +0 -3
- package/schema/CurrencyCodeSchema.d.ts +20 -6
- package/schema/CurrencyCodeSchema.js +0 -1
- package/schema/DataSchema.d.ts +2 -9
- package/schema/DataSchema.js +0 -6
- package/schema/DateSchema.d.ts +7 -7
- package/schema/DateSchema.js +0 -2
- package/schema/DateTimeSchema.d.ts +0 -2
- package/schema/DateTimeSchema.js +0 -2
- package/schema/DictionarySchema.d.ts +10 -7
- package/schema/DictionarySchema.js +0 -3
- package/schema/EmailSchema.d.ts +19 -9
- package/schema/EmailSchema.js +0 -6
- package/schema/EntitySchema.d.ts +1 -4
- package/schema/EntitySchema.js +0 -2
- package/schema/FileSchema.d.ts +0 -5
- package/schema/FileSchema.js +0 -5
- package/schema/KeySchema.d.ts +0 -2
- package/schema/KeySchema.js +0 -2
- package/schema/NullableSchema.d.ts +4 -7
- package/schema/NullableSchema.js +0 -4
- package/schema/NumberSchema.d.ts +14 -15
- package/schema/NumberSchema.js +0 -9
- package/schema/OptionalSchema.d.ts +1 -6
- package/schema/OptionalSchema.js +0 -3
- package/schema/PasswordSchema.d.ts +0 -6
- package/schema/PasswordSchema.js +0 -6
- package/schema/PhoneSchema.d.ts +19 -9
- package/schema/PhoneSchema.js +0 -6
- package/schema/RequiredSchema.d.ts +0 -1
- package/schema/RequiredSchema.js +0 -1
- package/schema/Schema.d.ts +0 -2
- package/schema/Schema.js +0 -2
- package/schema/SlugSchema.d.ts +18 -4
- package/schema/SlugSchema.js +0 -2
- package/schema/StringSchema.d.ts +22 -17
- package/schema/StringSchema.js +0 -10
- package/schema/ThroughSchema.d.ts +1 -2
- package/schema/ThroughSchema.js +0 -2
- package/schema/TimeSchema.d.ts +0 -2
- package/schema/TimeSchema.js +0 -2
- package/schema/URISchema.d.ts +24 -8
- package/schema/URISchema.js +0 -4
- package/schema/URLSchema.d.ts +25 -9
- package/schema/URLSchema.js +0 -4
- package/schema/UUIDSchema.d.ts +16 -5
- package/schema/UUIDSchema.js +0 -3
- package/ui/block/Heading.d.ts +0 -1
- package/ui/block/Heading.js +0 -1
- package/ui/block/Heading.tsx +0 -1
- package/ui/block/Image.d.ts +0 -1
- package/ui/block/Image.js +0 -1
- package/ui/block/Image.tsx +0 -1
- package/ui/block/Label.d.ts +0 -1
- package/ui/block/Label.js +0 -1
- package/ui/block/Label.tsx +0 -1
- package/ui/block/List.d.ts +0 -1
- package/ui/block/List.js +0 -1
- package/ui/block/List.tsx +0 -1
- package/ui/block/Panel.d.ts +0 -1
- package/ui/block/Panel.js +0 -1
- package/ui/block/Panel.tsx +0 -1
- package/ui/block/Paragraph.d.ts +0 -1
- package/ui/block/Paragraph.js +0 -1
- package/ui/block/Paragraph.tsx +0 -1
- package/ui/block/Preformatted.d.ts +0 -1
- package/ui/block/Preformatted.js +0 -1
- package/ui/block/Preformatted.module.css +0 -1
- package/ui/block/Preformatted.tsx +0 -1
- package/ui/block/Prose.d.ts +0 -1
- package/ui/block/Prose.js +0 -1
- package/ui/block/Prose.tsx +0 -1
- package/ui/block/Section.d.ts +0 -6
- package/ui/block/Section.js +0 -6
- package/ui/block/Section.tsx +0 -6
- package/ui/block/Subheading.d.ts +0 -1
- package/ui/block/Subheading.js +0 -1
- package/ui/block/Subheading.tsx +0 -1
- package/ui/block/Table.d.ts +0 -1
- package/ui/block/Table.js +0 -1
- package/ui/block/Table.tsx +0 -1
- package/ui/block/TableCell.d.ts +0 -1
- package/ui/block/TableCell.js +0 -1
- package/ui/block/TableCell.tsx +0 -1
- package/ui/block/TableHeader.d.ts +0 -1
- package/ui/block/TableHeader.js +0 -1
- package/ui/block/TableHeader.tsx +0 -1
- package/ui/block/Title.d.ts +0 -1
- package/ui/block/Title.js +0 -1
- package/ui/block/Title.tsx +0 -1
- package/ui/block/Video.d.ts +0 -3
- package/ui/block/Video.js +0 -3
- package/ui/block/Video.tsx +0 -3
- package/ui/docs/DocumentationCard.d.ts +0 -1
- package/ui/docs/DocumentationCard.js +0 -1
- package/ui/docs/DocumentationCard.tsx +0 -1
- package/ui/docs/DocumentationHomePage.d.ts +0 -1
- package/ui/docs/DocumentationHomePage.js +0 -1
- package/ui/docs/DocumentationHomePage.tsx +0 -1
- package/ui/docs/DocumentationKind.d.ts +0 -1
- package/ui/docs/DocumentationKind.js +0 -1
- package/ui/docs/DocumentationKind.tsx +0 -1
- package/ui/docs/DocumentationPage.d.ts +0 -1
- package/ui/docs/DocumentationPage.js +0 -1
- package/ui/docs/DocumentationPage.tsx +0 -1
- package/ui/docs/DocumentationSignatures.d.ts +0 -1
- package/ui/docs/DocumentationSignatures.js +0 -1
- package/ui/docs/DocumentationSignatures.tsx +0 -1
- package/ui/form/ArrayInput.d.ts +0 -1
- package/ui/form/ArrayInput.tsx +0 -1
- package/ui/form/ArrayRadioInputs.d.ts +0 -1
- package/ui/form/ArrayRadioInputs.js +0 -1
- package/ui/form/ArrayRadioInputs.tsx +0 -1
- package/ui/form/ButtonInput.d.ts +0 -1
- package/ui/form/ButtonInput.js +0 -1
- package/ui/form/ButtonInput.tsx +0 -1
- package/ui/form/ButtonInputPopover.d.ts +0 -1
- package/ui/form/ButtonInputPopover.js +0 -1
- package/ui/form/ButtonInputPopover.tsx +0 -1
- package/ui/form/ButtonPopover.d.ts +0 -1
- package/ui/form/ButtonPopover.js +0 -1
- package/ui/form/ButtonPopover.tsx +0 -1
- package/ui/form/CheckboxInput.d.ts +0 -1
- package/ui/form/CheckboxInput.js +0 -1
- package/ui/form/CheckboxInput.tsx +0 -1
- package/ui/form/ChoiceRadioInputs.d.ts +0 -1
- package/ui/form/ChoiceRadioInputs.tsx +0 -1
- package/ui/form/DataInput.d.ts +0 -1
- package/ui/form/DataInput.tsx +0 -1
- package/ui/form/DateInput.d.ts +0 -1
- package/ui/form/DateInput.js +0 -1
- package/ui/form/DateInput.tsx +0 -1
- package/ui/form/DictionaryInput.d.ts +0 -1
- package/ui/form/DictionaryInput.tsx +0 -1
- package/ui/form/FileInput.d.ts +0 -1
- package/ui/form/FileInput.js +0 -1
- package/ui/form/FileInput.tsx +0 -1
- package/ui/form/Form.d.ts +0 -1
- package/ui/form/Form.tsx +0 -1
- package/ui/form/FormFields.d.ts +0 -1
- package/ui/form/FormFields.js +0 -1
- package/ui/form/FormFields.tsx +0 -1
- package/ui/form/FormFooter.d.ts +0 -1
- package/ui/form/FormFooter.js +0 -1
- package/ui/form/FormFooter.tsx +0 -1
- package/ui/form/FormInput.d.ts +0 -1
- package/ui/form/FormInput.js +0 -1
- package/ui/form/FormInput.tsx +0 -1
- package/ui/form/Input.d.ts +0 -1
- package/ui/form/Input.js +0 -1
- package/ui/form/Input.tsx +0 -1
- package/ui/form/NumberInput.d.ts +0 -1
- package/ui/form/NumberInput.js +0 -1
- package/ui/form/NumberInput.tsx +0 -1
- package/ui/form/OutputInput.d.ts +0 -1
- package/ui/form/OutputInput.js +0 -1
- package/ui/form/OutputInput.tsx +0 -1
- package/ui/form/Popover.d.ts +0 -1
- package/ui/form/Popover.js +0 -1
- package/ui/form/Popover.tsx +0 -1
- package/ui/form/Progress.d.ts +0 -2
- package/ui/form/Progress.js +0 -2
- package/ui/form/Progress.tsx +0 -2
- package/ui/form/QueryInput.d.ts +0 -1
- package/ui/form/QueryInput.js +0 -1
- package/ui/form/QueryInput.tsx +0 -1
- package/ui/form/RadioInput.d.ts +0 -1
- package/ui/form/RadioInput.js +0 -1
- package/ui/form/RadioInput.tsx +0 -1
- package/ui/form/SchemaInput.d.ts +0 -10
- package/ui/form/SchemaInput.js +0 -9
- package/ui/form/SchemaInput.tsx +0 -10
- package/ui/form/SelectInput.d.ts +0 -1
- package/ui/form/SelectInput.tsx +0 -1
- package/ui/form/SubmitButton.d.ts +0 -1
- package/ui/form/SubmitButton.js +0 -1
- package/ui/form/SubmitButton.tsx +0 -1
- package/ui/form/TextInput.d.ts +0 -1
- package/ui/form/TextInput.js +0 -1
- package/ui/form/TextInput.tsx +0 -1
- package/ui/inline/Code.d.ts +0 -1
- package/ui/inline/Code.js +0 -1
- package/ui/inline/Code.tsx +0 -1
- package/ui/inline/Deleted.d.ts +0 -1
- package/ui/inline/Deleted.js +0 -1
- package/ui/inline/Deleted.tsx +0 -1
- package/ui/inline/Emphasis.d.ts +0 -1
- package/ui/inline/Emphasis.js +0 -1
- package/ui/inline/Emphasis.tsx +0 -1
- package/ui/inline/Inserted.d.ts +0 -1
- package/ui/inline/Inserted.js +0 -1
- package/ui/inline/Inserted.tsx +0 -1
- package/ui/inline/Link.d.ts +0 -1
- package/ui/inline/Link.js +0 -1
- package/ui/inline/Link.tsx +0 -1
- package/ui/inline/Mark.d.ts +0 -1
- package/ui/inline/Mark.js +0 -1
- package/ui/inline/Mark.tsx +0 -1
- package/ui/inline/Small.d.ts +0 -1
- package/ui/inline/Small.js +0 -1
- package/ui/inline/Small.tsx +0 -1
- package/ui/inline/Strong.d.ts +0 -1
- package/ui/inline/Strong.js +0 -1
- package/ui/inline/Strong.tsx +0 -1
- package/ui/inline/Subscript.d.ts +0 -1
- package/ui/inline/Subscript.js +0 -1
- package/ui/inline/Subscript.tsx +0 -1
- package/ui/inline/Superscript.d.ts +0 -1
- package/ui/inline/Superscript.js +0 -1
- package/ui/inline/Superscript.tsx +0 -1
- package/ui/inline/When.d.ts +2 -3
- package/ui/inline/When.js +0 -3
- package/ui/inline/When.tsx +2 -3
- package/ui/menu/Menu.d.ts +0 -1
- package/ui/menu/Menu.js +0 -1
- package/ui/menu/Menu.tsx +0 -1
- package/ui/misc/Catcher.d.ts +0 -1
- package/ui/misc/Catcher.js +0 -1
- package/ui/misc/Catcher.tsx +0 -1
- package/ui/misc/Markup.d.ts +0 -1
- package/ui/misc/Markup.js +0 -1
- package/ui/misc/Markup.tsx +0 -1
- package/ui/misc/Tag.d.ts +0 -1
- package/ui/misc/Tag.js +0 -1
- package/ui/misc/Tag.tsx +0 -1
- package/ui/notice/Message.d.ts +0 -1
- package/ui/notice/Message.js +0 -1
- package/ui/notice/Message.tsx +0 -1
- package/ui/notice/Notice.d.ts +0 -1
- package/ui/notice/Notice.js +0 -1
- package/ui/notice/Notice.tsx +0 -1
- package/ui/notice/Notices.d.ts +0 -1
- package/ui/notice/Notices.js +0 -1
- package/ui/notice/Notices.tsx +0 -1
- package/ui/router/NavigationStore.d.ts +1 -1
- package/ui/router/NavigationStore.js +2 -2
- package/ui/router/NavigationStore.tsx +2 -2
- package/ui/style/Color.d.ts +0 -1
- package/ui/style/Color.js +0 -1
- package/ui/style/Color.tsx +0 -1
- package/ui/style/Duration.d.ts +0 -1
- package/ui/style/Duration.js +0 -1
- package/ui/style/Duration.tsx +0 -1
- package/ui/style/Flex.d.ts +0 -3
- package/ui/style/Flex.js +0 -3
- package/ui/style/Flex.tsx +0 -3
- package/ui/style/Font.d.ts +0 -1
- package/ui/style/Font.js +0 -1
- package/ui/style/Font.tsx +0 -1
- package/ui/style/Gap.d.ts +0 -1
- package/ui/style/Gap.js +0 -1
- package/ui/style/Gap.tsx +0 -1
- package/ui/style/Padding.d.ts +0 -1
- package/ui/style/Padding.js +0 -1
- package/ui/style/Padding.tsx +0 -1
- package/ui/style/Radius.d.ts +0 -1
- package/ui/style/Radius.js +0 -1
- package/ui/style/Radius.tsx +0 -1
- package/ui/style/Scroll.d.ts +0 -2
- package/ui/style/Scroll.js +0 -2
- package/ui/style/Scroll.module.css +0 -1
- package/ui/style/Scroll.tsx +0 -2
- package/ui/style/Shadow.d.ts +0 -1
- package/ui/style/Shadow.js +0 -1
- package/ui/style/Shadow.tsx +0 -1
- package/ui/style/Size.d.ts +0 -1
- package/ui/style/Size.js +0 -1
- package/ui/style/Size.tsx +0 -1
- package/ui/style/Space.d.ts +0 -1
- package/ui/style/Space.js +0 -1
- package/ui/style/Space.tsx +0 -1
- package/ui/style/Status.d.ts +0 -1
- package/ui/style/Status.js +0 -1
- package/ui/style/Status.tsx +0 -1
- package/ui/style/Stroke.d.ts +0 -1
- package/ui/style/Stroke.js +0 -1
- package/ui/style/Stroke.tsx +0 -1
- package/ui/style/Typography.d.ts +0 -1
- package/ui/style/Typography.js +0 -1
- package/ui/style/Typography.tsx +0 -1
- package/ui/style/Weight.d.ts +0 -1
- package/ui/style/Weight.js +0 -1
- package/ui/style/Weight.tsx +0 -1
- package/ui/style/Width.d.ts +0 -1
- package/ui/style/Width.js +0 -1
- package/ui/style/Width.tsx +0 -1
- package/ui/transition/CollapseTransition.d.ts +0 -1
- package/ui/transition/CollapseTransition.js +0 -1
- package/ui/transition/CollapseTransition.tsx +0 -1
- package/ui/transition/FadeTransition.d.ts +0 -1
- package/ui/transition/FadeTransition.js +0 -1
- package/ui/transition/FadeTransition.tsx +0 -1
- package/ui/transition/HorizontalTransition.d.ts +0 -1
- package/ui/transition/HorizontalTransition.js +0 -1
- package/ui/transition/HorizontalTransition.tsx +0 -1
- package/ui/transition/VerticalTransition.d.ts +0 -1
- package/ui/transition/VerticalTransition.js +0 -1
- package/ui/transition/VerticalTransition.tsx +0 -1
- package/ui/tree/TreeApp.d.ts +0 -1
- package/ui/tree/TreeApp.js +0 -1
- package/ui/tree/TreeApp.tsx +0 -1
- package/ui/tree/TreeBreadcrumbs.d.ts +0 -1
- package/ui/tree/TreeBreadcrumbs.js +0 -1
- package/ui/tree/TreeBreadcrumbs.tsx +0 -1
- package/ui/tree/TreeButton.d.ts +0 -1
- package/ui/tree/TreeButton.js +0 -1
- package/ui/tree/TreeButton.tsx +0 -1
- package/ui/tree/TreeCard.d.ts +0 -1
- package/ui/tree/TreeCard.js +0 -1
- package/ui/tree/TreeCard.tsx +0 -1
- package/ui/tree/TreeCards.d.ts +0 -1
- package/ui/tree/TreeCards.js +0 -1
- package/ui/tree/TreeCards.tsx +0 -1
- package/ui/tree/TreeLink.d.ts +0 -1
- package/ui/tree/TreeLink.js +0 -1
- package/ui/tree/TreeLink.tsx +0 -1
- package/ui/tree/TreeMenu.d.ts +0 -1
- package/ui/tree/TreeMenu.js +0 -1
- package/ui/tree/TreeMenu.tsx +0 -1
- package/ui/tree/TreePage.d.ts +0 -1
- package/ui/tree/TreePage.js +0 -1
- package/ui/tree/TreePage.tsx +0 -1
- package/ui/tree/TreeRouter.d.ts +0 -1
- package/ui/tree/TreeRouter.js +0 -1
- package/ui/tree/TreeRouter.tsx +0 -1
- package/ui/tree/TreeSidebar.d.ts +0 -1
- package/ui/tree/TreeSidebar.js +0 -1
- package/ui/tree/TreeSidebar.tsx +0 -1
- package/util/color.d.ts +0 -1
- package/util/color.js +0 -1
- package/util/start.d.ts +0 -1
- package/util/start.js +0 -1
- package/util/tree.d.ts +0 -1
- package/util/tree.js +0 -1
- package/util/units.d.ts +0 -1
- package/util/units.js +0 -1
|
@@ -68,7 +68,6 @@ export declare class ClientAPIProvider<P = unknown, R = unknown> extends APIProv
|
|
|
68
68
|
/**
|
|
69
69
|
* Create a `ClientAPIProvider` from a base URL and request options.
|
|
70
70
|
*
|
|
71
|
-
* @param options The `ClientAPIProviderOptions` configuring the base `url`, default request `options`, and `timeout`.
|
|
72
71
|
* @throws {RequiredError} if `url` cannot be resolved to a valid base URL.
|
|
73
72
|
* @example new ClientAPIProvider({ url: "https://api.example.com" })
|
|
74
73
|
* @see https://dhoulb.github.io/shelving/api/provider/ClientAPIProvider/ClientAPIProvider
|
|
@@ -42,7 +42,6 @@ export class ClientAPIProvider extends APIProvider {
|
|
|
42
42
|
/**
|
|
43
43
|
* Create a `ClientAPIProvider` from a base URL and request options.
|
|
44
44
|
*
|
|
45
|
-
* @param options The `ClientAPIProviderOptions` configuring the base `url`, default request `options`, and `timeout`.
|
|
46
45
|
* @throws {RequiredError} if `url` cannot be resolved to a valid base URL.
|
|
47
46
|
* @example new ClientAPIProvider({ url: "https://api.example.com" })
|
|
48
47
|
* @see https://dhoulb.github.io/shelving/api/provider/ClientAPIProvider/ClientAPIProvider
|
|
@@ -66,7 +66,6 @@ export declare class Collection<N extends string = string, I extends Identifier
|
|
|
66
66
|
* @param name Collection name used as the table/collection key.
|
|
67
67
|
* @param id Schema for the identifier type.
|
|
68
68
|
* @param data Data schema, or the `Schemas` props used to construct one.
|
|
69
|
-
* @returns A new `Collection` instance.
|
|
70
69
|
* @example COLLECTION("users", ID, { name: STRING, age: NUMBER }) // Collection<"users", number, { name: string; age: number }>
|
|
71
70
|
* @see https://dhoulb.github.io/shelving/db/collection/Collection/COLLECTION
|
|
72
71
|
*/
|
|
@@ -77,7 +77,6 @@ export class Collection extends DataSchema {
|
|
|
77
77
|
* @param name Collection name used as the table/collection key.
|
|
78
78
|
* @param id Schema for the identifier type.
|
|
79
79
|
* @param data Data schema, or the `Schemas` props used to construct one.
|
|
80
|
-
* @returns A new `Collection` instance.
|
|
81
80
|
* @example COLLECTION("users", ID, { name: STRING, age: NUMBER }) // Collection<"users", number, { name: string; age: number }>
|
|
82
81
|
* @see https://dhoulb.github.io/shelving/db/collection/Collection/COLLECTION
|
|
83
82
|
*/
|
package/error/Errors.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export declare class Errors extends AggregateError implements BaseError {
|
|
|
15
15
|
*
|
|
16
16
|
* @param errors Iterable of the individual errors being aggregated.
|
|
17
17
|
* @param message Optional human-readable message describing the aggregate failure.
|
|
18
|
-
* @param options Optional `BaseErrorOptions` — `caller` and contextual fields are applied via `setBaseErrorOptions()`.
|
|
19
18
|
*/
|
|
20
19
|
constructor(errors: Iterable<unknown>, message?: string, options?: BaseErrorOptions);
|
|
21
20
|
}
|
package/error/Errors.js
CHANGED
|
@@ -13,7 +13,6 @@ export class Errors extends AggregateError {
|
|
|
13
13
|
*
|
|
14
14
|
* @param errors Iterable of the individual errors being aggregated.
|
|
15
15
|
* @param message Optional human-readable message describing the aggregate failure.
|
|
16
|
-
* @param options Optional `BaseErrorOptions` — `caller` and contextual fields are applied via `setBaseErrorOptions()`.
|
|
17
16
|
*/
|
|
18
17
|
constructor(errors, message, options = {}) {
|
|
19
18
|
super(errors, message, options);
|
package/error/NetworkError.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export declare class NetworkError extends Error implements BaseError {
|
|
|
13
13
|
* Create a new `NetworkError`.
|
|
14
14
|
*
|
|
15
15
|
* @param message Optional human-readable description of the network problem.
|
|
16
|
-
* @param options Optional `BaseErrorOptions` — `caller` and contextual fields are applied via `setBaseErrorOptions()`.
|
|
17
16
|
*/
|
|
18
17
|
constructor(message?: string, options?: BaseErrorOptions);
|
|
19
18
|
}
|
package/error/NetworkError.js
CHANGED
|
@@ -11,7 +11,6 @@ export class NetworkError extends Error {
|
|
|
11
11
|
* Create a new `NetworkError`.
|
|
12
12
|
*
|
|
13
13
|
* @param message Optional human-readable description of the network problem.
|
|
14
|
-
* @param options Optional `BaseErrorOptions` — `caller` and contextual fields are applied via `setBaseErrorOptions()`.
|
|
15
14
|
*/
|
|
16
15
|
constructor(message, options = {}) {
|
|
17
16
|
super(message, options);
|
package/error/RequiredError.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export declare class RequiredError extends Error implements BaseError {
|
|
|
14
14
|
* Create a new `RequiredError`.
|
|
15
15
|
*
|
|
16
16
|
* @param message Optional human-readable description of what was required but missing.
|
|
17
|
-
* @param options Optional `BaseErrorOptions` — `caller` and contextual fields are applied via `setBaseErrorOptions()`.
|
|
18
17
|
*/
|
|
19
18
|
constructor(message?: string, options?: BaseErrorOptions);
|
|
20
19
|
}
|
package/error/RequiredError.js
CHANGED
|
@@ -12,7 +12,6 @@ export class RequiredError extends Error {
|
|
|
12
12
|
* Create a new `RequiredError`.
|
|
13
13
|
*
|
|
14
14
|
* @param message Optional human-readable description of what was required but missing.
|
|
15
|
-
* @param options Optional `BaseErrorOptions` — `caller` and contextual fields are applied via `setBaseErrorOptions()`.
|
|
16
15
|
*/
|
|
17
16
|
constructor(message, options = {}) {
|
|
18
17
|
super(message, options);
|
|
@@ -14,7 +14,6 @@ export declare class UnexpectedError extends Error implements BaseError {
|
|
|
14
14
|
* Create a new `UnexpectedError`.
|
|
15
15
|
*
|
|
16
16
|
* @param message Optional human-readable description of the unexpected condition.
|
|
17
|
-
* @param options Optional `BaseErrorOptions` — `caller` and contextual fields are applied via `setBaseErrorOptions()`.
|
|
18
17
|
*/
|
|
19
18
|
constructor(message?: string, options?: BaseErrorOptions);
|
|
20
19
|
}
|
package/error/UnexpectedError.js
CHANGED
|
@@ -12,7 +12,6 @@ export class UnexpectedError extends Error {
|
|
|
12
12
|
* Create a new `UnexpectedError`.
|
|
13
13
|
*
|
|
14
14
|
* @param message Optional human-readable description of the unexpected condition.
|
|
15
|
-
* @param options Optional `BaseErrorOptions` — `caller` and contextual fields are applied via `setBaseErrorOptions()`.
|
|
16
15
|
*/
|
|
17
16
|
constructor(message, options = {}) {
|
|
18
17
|
super(message, options);
|
|
@@ -13,7 +13,6 @@ export declare class UnimplementedError extends Error implements BaseError {
|
|
|
13
13
|
* Create a new `UnimplementedError`.
|
|
14
14
|
*
|
|
15
15
|
* @param message Optional human-readable description of the missing implementation.
|
|
16
|
-
* @param options Optional `BaseErrorOptions` — `caller` and contextual fields are applied via `setBaseErrorOptions()`.
|
|
17
16
|
*/
|
|
18
17
|
constructor(message?: string, options?: BaseErrorOptions);
|
|
19
18
|
}
|
|
@@ -11,7 +11,6 @@ export class UnimplementedError extends Error {
|
|
|
11
11
|
* Create a new `UnimplementedError`.
|
|
12
12
|
*
|
|
13
13
|
* @param message Optional human-readable description of the missing implementation.
|
|
14
|
-
* @param options Optional `BaseErrorOptions` — `caller` and contextual fields are applied via `setBaseErrorOptions()`.
|
|
15
14
|
*/
|
|
16
15
|
constructor(message, options = {}) {
|
|
17
16
|
super(message, options);
|
package/error/ValueError.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export declare class ValueError extends Error implements BaseError {
|
|
|
14
14
|
* Create a new `ValueError`.
|
|
15
15
|
*
|
|
16
16
|
* @param message Optional human-readable description of why the value is wrong.
|
|
17
|
-
* @param options Optional `BaseErrorOptions` — `caller` and contextual fields are applied via `setBaseErrorOptions()`.
|
|
18
17
|
*/
|
|
19
18
|
constructor(message?: string, options?: BaseErrorOptions);
|
|
20
19
|
}
|
package/error/ValueError.js
CHANGED
|
@@ -12,7 +12,6 @@ export class ValueError extends Error {
|
|
|
12
12
|
* Create a new `ValueError`.
|
|
13
13
|
*
|
|
14
14
|
* @param message Optional human-readable description of why the value is wrong.
|
|
15
|
-
* @param options Optional `BaseErrorOptions` — `caller` and contextual fields are applied via `setBaseErrorOptions()`.
|
|
16
15
|
*/
|
|
17
16
|
constructor(message, options = {}) {
|
|
18
17
|
super(message, options);
|
|
@@ -43,8 +43,6 @@ export declare class DirectoryExtractor extends Extractor<Path, TreeElement> {
|
|
|
43
43
|
/**
|
|
44
44
|
* Create a directory extractor with optional extractor dispatch, base path, and ignore patterns.
|
|
45
45
|
*
|
|
46
|
-
* @param options Options including the `extractors` dispatch table, `base` path, and `ignore` patterns.
|
|
47
|
-
*
|
|
48
46
|
* @example const extractor = new DirectoryExtractor({ base: "/repo/modules" });
|
|
49
47
|
*/
|
|
50
48
|
constructor({ extractors, base, ignore }?: DirectoryExtractorOptions);
|
|
@@ -38,8 +38,6 @@ export class DirectoryExtractor extends Extractor {
|
|
|
38
38
|
/**
|
|
39
39
|
* Create a directory extractor with optional extractor dispatch, base path, and ignore patterns.
|
|
40
40
|
*
|
|
41
|
-
* @param options Options including the `extractors` dispatch table, `base` path, and `ignore` patterns.
|
|
42
|
-
*
|
|
43
41
|
* @example const extractor = new DirectoryExtractor({ base: "/repo/modules" });
|
|
44
42
|
*/
|
|
45
43
|
constructor({ extractors = DEFAULT_EXTRACTORS, base, ignore = DEFAULT_IGNORE } = {}) {
|
|
@@ -31,7 +31,6 @@ export declare class IndexExtractor<I> extends ThroughExtractor<I, TreeElement>
|
|
|
31
31
|
* Wrap a source extractor so each element's index child is absorbed into the element itself.
|
|
32
32
|
*
|
|
33
33
|
* @param source Upstream extractor that produces the `tree-element` tree to process.
|
|
34
|
-
* @param options Options including the `index` filename patterns.
|
|
35
34
|
*
|
|
36
35
|
* @example const extractor = new IndexExtractor(new DirectoryExtractor());
|
|
37
36
|
*/
|
|
@@ -25,7 +25,6 @@ export class IndexExtractor extends ThroughExtractor {
|
|
|
25
25
|
* Wrap a source extractor so each element's index child is absorbed into the element itself.
|
|
26
26
|
*
|
|
27
27
|
* @param source Upstream extractor that produces the `tree-element` tree to process.
|
|
28
|
-
* @param options Options including the `index` filename patterns.
|
|
29
28
|
*
|
|
30
29
|
* @example const extractor = new IndexExtractor(new DirectoryExtractor());
|
|
31
30
|
*/
|
|
@@ -36,7 +36,6 @@ export declare class MergingExtractor<I> extends ThroughExtractor<I, TreeElement
|
|
|
36
36
|
* Wrap a source extractor so its produced tree has same-template sibling elements merged.
|
|
37
37
|
*
|
|
38
38
|
* @param source Upstream extractor that produces the `tree-element` tree to merge.
|
|
39
|
-
* @param options Options including the `merges` template map.
|
|
40
39
|
*
|
|
41
40
|
* @example const extractor = new MergingExtractor(new DirectoryExtractor());
|
|
42
41
|
*/
|
|
@@ -31,7 +31,6 @@ export class MergingExtractor extends ThroughExtractor {
|
|
|
31
31
|
* Wrap a source extractor so its produced tree has same-template sibling elements merged.
|
|
32
32
|
*
|
|
33
33
|
* @param source Upstream extractor that produces the `tree-element` tree to merge.
|
|
34
|
-
* @param options Options including the `merges` template map.
|
|
35
34
|
*
|
|
36
35
|
* @example const extractor = new MergingExtractor(new DirectoryExtractor());
|
|
37
36
|
*/
|
|
@@ -48,8 +48,6 @@ export declare class PackageExtractor extends Extractor<Path, TreeElement> {
|
|
|
48
48
|
/**
|
|
49
49
|
* Create a package extractor bound to a pre-extracted source tree.
|
|
50
50
|
*
|
|
51
|
-
* @param options Options including the source `tree`, `extensions` mapping, `module` extractor, and `base` path.
|
|
52
|
-
*
|
|
53
51
|
* @example const extractor = new PackageExtractor({ tree: sourceTree });
|
|
54
52
|
*/
|
|
55
53
|
constructor({ tree, extensions, module, base }: PackageExtractorOptions);
|
|
@@ -32,8 +32,6 @@ export class PackageExtractor extends Extractor {
|
|
|
32
32
|
/**
|
|
33
33
|
* Create a package extractor bound to a pre-extracted source tree.
|
|
34
34
|
*
|
|
35
|
-
* @param options Options including the source `tree`, `extensions` mapping, `module` extractor, and `base` path.
|
|
36
|
-
*
|
|
37
35
|
* @example const extractor = new PackageExtractor({ tree: sourceTree });
|
|
38
36
|
*/
|
|
39
37
|
constructor({ tree, extensions = DEFAULT_EXTENSIONS, module = new ModuleExtractor(), base }) {
|
|
@@ -4,7 +4,8 @@ import { FileExtractor } from "./FileExtractor.js";
|
|
|
4
4
|
* File extractor that parses a TypeScript source file into a tree element.
|
|
5
5
|
* - Uses the TypeScript compiler API to parse the AST.
|
|
6
6
|
* - Extracts exported, public, non-`_`-prefixed declarations as `tree-documentation` children.
|
|
7
|
-
* - Overloaded declarations sharing a name are merged into a single `tree-documentation` with multiple `signatures`.
|
|
7
|
+
* - Overloaded declarations sharing a name are merged into a single `tree-documentation` with multiple `signatures`. When a function (or constructor) is overloaded, the implementation declaration (the "base definition") is dropped entirely — only the overload signatures are documented.
|
|
8
|
+
* - A `@param name {Type}` (or `@returns {Type}`) whose `{Type}` is given is canonical: it supersedes the inferred type from the base definition and any overloads. Multiple `@param name` tags for one parameter each emit a row, letting a single parameter be documented as several typed variants.
|
|
8
9
|
* - Class declarations synthesise their `signatures`, `params`, and `returns` from the constructor — `new ClassName<…>(…)` including generics, one signature per constructor overload, with `returns` set to the class type. Param descriptions come from the constructor's `@param` first, then the class's `@param`.
|
|
9
10
|
* - A `@kind` tag in a symbol's JSDoc overrides the inferred kind — e.g. `@kind component` relabels a React component (otherwise a `function`) so the docs site groups and colours it as a component. The override also drops the trailing `()` from the title, since a non-function kind reads as a bare name.
|
|
10
11
|
* - Sets `description` (a plain-text summary from the first JSDoc paragraph) on every `tree-documentation` child.
|
|
@@ -5,7 +5,8 @@ import { extractMarkdownProps } from "./MarkupExtractor.js";
|
|
|
5
5
|
* File extractor that parses a TypeScript source file into a tree element.
|
|
6
6
|
* - Uses the TypeScript compiler API to parse the AST.
|
|
7
7
|
* - Extracts exported, public, non-`_`-prefixed declarations as `tree-documentation` children.
|
|
8
|
-
* - Overloaded declarations sharing a name are merged into a single `tree-documentation` with multiple `signatures`.
|
|
8
|
+
* - Overloaded declarations sharing a name are merged into a single `tree-documentation` with multiple `signatures`. When a function (or constructor) is overloaded, the implementation declaration (the "base definition") is dropped entirely — only the overload signatures are documented.
|
|
9
|
+
* - A `@param name {Type}` (or `@returns {Type}`) whose `{Type}` is given is canonical: it supersedes the inferred type from the base definition and any overloads. Multiple `@param name` tags for one parameter each emit a row, letting a single parameter be documented as several typed variants.
|
|
9
10
|
* - Class declarations synthesise their `signatures`, `params`, and `returns` from the constructor — `new ClassName<…>(…)` including generics, one signature per constructor overload, with `returns` set to the class type. Param descriptions come from the constructor's `@param` first, then the class's `@param`.
|
|
10
11
|
* - A `@kind` tag in a symbol's JSDoc overrides the inferred kind — e.g. `@kind component` relabels a React component (otherwise a `function`) so the docs site groups and colours it as a component. The override also drops the trailing `()` from the title, since a non-function kind reads as a bare name.
|
|
11
12
|
* - Sets `description` (a plain-text summary from the first JSDoc paragraph) on every `tree-documentation` child.
|
|
@@ -35,9 +36,18 @@ export class TypescriptExtractor extends FileExtractor {
|
|
|
35
36
|
*/
|
|
36
37
|
extractProps(name, text) {
|
|
37
38
|
const source = ts.createSourceFile(name, text, ts.ScriptTarget.Latest, true);
|
|
39
|
+
// Names with one or more overload signatures (bodyless function declarations). When a function is overloaded, the
|
|
40
|
+
// implementation declaration (the one with a body — the "base definition") is dropped entirely; only the overloads are documented.
|
|
41
|
+
const overloaded = new Set();
|
|
42
|
+
for (const statement of source.statements)
|
|
43
|
+
if (ts.isFunctionDeclaration(statement) && !statement.body && statement.name)
|
|
44
|
+
overloaded.add(statement.name.text);
|
|
38
45
|
// Collect elements by key, merging overloads (same name) by appending signatures.
|
|
39
46
|
const byKey = new Map();
|
|
40
47
|
for (const statement of source.statements) {
|
|
48
|
+
// Skip the implementation of an overloaded function — overloads supersede the base definition.
|
|
49
|
+
if (ts.isFunctionDeclaration(statement) && statement.body && statement.name && overloaded.has(statement.name.text))
|
|
50
|
+
continue;
|
|
41
51
|
const element = _extractStatement(statement, source);
|
|
42
52
|
if (!element)
|
|
43
53
|
continue;
|
|
@@ -304,9 +314,11 @@ function _getTypeParamNames(statement, source) {
|
|
|
304
314
|
return "";
|
|
305
315
|
return `<${typeParameters.map(t => t.name.getText(source)).join(", ")}>`;
|
|
306
316
|
}
|
|
307
|
-
/** Get a class's constructor declarations
|
|
317
|
+
/** Get a class's constructor declarations in source order — when overloaded, only the overload signatures (the implementation, i.e. the base definition, is dropped). */
|
|
308
318
|
function _getConstructors(statement) {
|
|
309
|
-
|
|
319
|
+
const constructors = statement.members.filter(ts.isConstructorDeclaration);
|
|
320
|
+
// When overload signatures exist, drop the implementation constructor (the one with a body) — overloads supersede the base definition.
|
|
321
|
+
return constructors.some(c => !c.body) ? constructors.filter(c => !c.body) : constructors;
|
|
310
322
|
}
|
|
311
323
|
/**
|
|
312
324
|
* Synthesise `new ClassName<…>(…)` signatures from a class's constructor declaration(s).
|
|
@@ -327,15 +339,37 @@ function _getParams(statement, source, jsDocParams) {
|
|
|
327
339
|
return _getConstructorParams(statement, source, jsDocParams);
|
|
328
340
|
if (!ts.isFunctionDeclaration(statement))
|
|
329
341
|
return;
|
|
330
|
-
const params = statement.parameters
|
|
342
|
+
const params = _buildParams(statement.parameters, source, jsDocParams);
|
|
343
|
+
return params.length ? params : undefined;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Build documentation params from a declaration's AST parameters, applying JSDoc `@param` overrides.
|
|
347
|
+
* - A `@param name {Type}` whose `{Type}` is given is canonical: it supersedes the parameter's inferred type from the base definition and any overloads.
|
|
348
|
+
* - Multiple `@param name` tags for the same parameter each emit a row, so a single parameter can be documented as several typed variants.
|
|
349
|
+
* - A `@param name` with no `{Type}` only supplies the description; the inferred type stands.
|
|
350
|
+
* - `primaryJsDocParams` win over `fallbackJsDocParams` per name (used by constructors: the constructor's own `@param` beats the class-level `@param`).
|
|
351
|
+
*/
|
|
352
|
+
function _buildParams(parameters, source, primaryJsDocParams, fallbackJsDocParams) {
|
|
353
|
+
const params = [];
|
|
354
|
+
for (const p of parameters) {
|
|
331
355
|
const name = p.name.getText(source);
|
|
332
356
|
const type = p.type?.getText(source);
|
|
333
357
|
const optional = !!p.questionToken || !!p.initializer;
|
|
334
|
-
const description = jsDocParams?.find(d => d.name === name)?.description;
|
|
335
358
|
const def = p.initializer?.getText(source);
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
359
|
+
// JSDoc `@param` entries for this name — the declaration's own take priority over the fallback (class-level) ones.
|
|
360
|
+
const primary = primaryJsDocParams?.filter(d => d.name === name) ?? [];
|
|
361
|
+
const matched = primary.length ? primary : (fallbackJsDocParams?.filter(d => d.name === name) ?? []);
|
|
362
|
+
// A `@param` carrying a `{Type}` is canonical — emit one row per typed entry, its type overriding the inferred type.
|
|
363
|
+
const typed = matched.filter(d => d.type);
|
|
364
|
+
if (typed.length) {
|
|
365
|
+
for (const d of typed)
|
|
366
|
+
params.push({ name, type: d.type, description: d.description, optional, default: def });
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
params.push({ name, type, description: matched[0]?.description, optional, default: def });
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return params;
|
|
339
373
|
}
|
|
340
374
|
/**
|
|
341
375
|
* Extract a class's constructor parameters as `params`, mirroring the function shape.
|
|
@@ -346,15 +380,8 @@ function _getConstructorParams(statement, source, classJsDocParams) {
|
|
|
346
380
|
let params;
|
|
347
381
|
for (const ctor of _getConstructors(statement)) {
|
|
348
382
|
const ctorJsDocParams = _getJSDoc(ctor, source)?.params;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
const type = p.type?.getText(source);
|
|
352
|
-
const optional = !!p.questionToken || !!p.initializer;
|
|
353
|
-
// Constructor-level `@param` wins over the class-level `@param` on collision.
|
|
354
|
-
const description = ctorJsDocParams?.find(d => d.name === name)?.description ?? classJsDocParams?.find(d => d.name === name)?.description;
|
|
355
|
-
const def = p.initializer?.getText(source);
|
|
356
|
-
return { name, type, description, optional, default: def };
|
|
357
|
-
});
|
|
383
|
+
// Constructor-level `@param` wins over the class-level `@param` on collision; a `@param {Type}` is canonical (see `_buildParams`).
|
|
384
|
+
const next = _buildParams(ctor.parameters, source, ctorJsDocParams, classJsDocParams);
|
|
358
385
|
params = _concatUnique(params, next, p => `${p.name}\0${p.type}\0${p.description}\0${p.optional}\0${p.default}`);
|
|
359
386
|
}
|
|
360
387
|
return params?.length ? params : undefined;
|
package/markup/MarkupParser.d.ts
CHANGED
|
@@ -97,8 +97,6 @@ export declare class MarkupParser implements Parser<string, ReactNode> {
|
|
|
97
97
|
/**
|
|
98
98
|
* Create a new `MarkupParser` from a set of options.
|
|
99
99
|
*
|
|
100
|
-
* @param options Options configuring the rules, link resolution, and default context (all optional).
|
|
101
|
-
* @returns A `MarkupParser` instance.
|
|
102
100
|
* @example new MarkupParser({ rel: "nofollow ugc" })
|
|
103
101
|
* @see https://dhoulb.github.io/shelving/markup/MarkupParser/MarkupParser
|
|
104
102
|
*/
|
package/markup/MarkupParser.js
CHANGED
|
@@ -55,8 +55,6 @@ export class MarkupParser {
|
|
|
55
55
|
/**
|
|
56
56
|
* Create a new `MarkupParser` from a set of options.
|
|
57
57
|
*
|
|
58
|
-
* @param options Options configuring the rules, link resolution, and default context (all optional).
|
|
59
|
-
* @returns A `MarkupParser` instance.
|
|
60
58
|
* @example new MarkupParser({ rel: "nofollow ugc" })
|
|
61
59
|
* @see https://dhoulb.github.io/shelving/markup/MarkupParser/MarkupParser
|
|
62
60
|
*/
|
package/package.json
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { type AddressData, formatAddress } from "../util/geo.js";
|
|
2
|
-
import { DataSchema
|
|
2
|
+
import { DataSchema } from "./DataSchema.js";
|
|
3
|
+
import type { SchemaOptions } from "./Schema.js";
|
|
3
4
|
export type { AddressData };
|
|
4
5
|
export { formatAddress };
|
|
5
6
|
/**
|
|
6
7
|
* Allowed options for `AddressSchema`.
|
|
7
8
|
*
|
|
9
|
+
* - The `props` are fixed to the postal-address fields internally, so only the default `value` and base schema options are exposed.
|
|
10
|
+
*
|
|
8
11
|
* @see https://dhoulb.github.io/shelving/schema/AddressSchema/AddressSchemaOptions
|
|
9
12
|
*/
|
|
10
|
-
export interface AddressSchemaOptions extends
|
|
13
|
+
export interface AddressSchemaOptions extends SchemaOptions {
|
|
14
|
+
/** Partial default value merged over the per-field defaults. */
|
|
15
|
+
readonly value?: Partial<AddressData> | undefined;
|
|
11
16
|
}
|
|
12
17
|
/**
|
|
13
18
|
* Schema that validates a postal address.
|
|
@@ -21,10 +26,6 @@ export interface AddressSchemaOptions extends Omit<DataSchemaOptions<AddressData
|
|
|
21
26
|
export declare class AddressSchema extends DataSchema<AddressData> {
|
|
22
27
|
/**
|
|
23
28
|
* Create a new `AddressSchema`.
|
|
24
|
-
*
|
|
25
|
-
* @param options Options for the schema (inherits `DataSchema` options except `props`, which is fixed to the postal-address fields).
|
|
26
|
-
* @param options.one Singular noun describing one value, used in error messages (defaults to `"address"`).
|
|
27
|
-
* @param options.title Title of the schema, e.g. for a corresponding field (defaults to `"Address"`).
|
|
28
29
|
*/
|
|
29
30
|
constructor({ one, title, ...options }?: AddressSchemaOptions);
|
|
30
31
|
/**
|
package/schema/AddressSchema.js
CHANGED
|
@@ -24,10 +24,6 @@ const ADDRESS_PROPS = {
|
|
|
24
24
|
export class AddressSchema extends DataSchema {
|
|
25
25
|
/**
|
|
26
26
|
* Create a new `AddressSchema`.
|
|
27
|
-
*
|
|
28
|
-
* @param options Options for the schema (inherits `DataSchema` options except `props`, which is fixed to the postal-address fields).
|
|
29
|
-
* @param options.one Singular noun describing one value, used in error messages (defaults to `"address"`).
|
|
30
|
-
* @param options.title Title of the schema, e.g. for a corresponding field (defaults to `"Address"`).
|
|
31
27
|
*/
|
|
32
28
|
constructor({ one = "address", title = "Address", ...options } = {}) {
|
|
33
29
|
super({ one, title, props: ADDRESS_PROPS, ...options });
|
package/schema/ArraySchema.d.ts
CHANGED
|
@@ -4,25 +4,35 @@ import { Schema } from "./Schema.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Options for `ArraySchema`.
|
|
6
6
|
*
|
|
7
|
-
* - `items` — schema every item in the array must conform to.
|
|
8
|
-
* - `min`/`max` — minimum and maximum number of items.
|
|
9
|
-
* - `unique` — deduplicate the items when set.
|
|
10
|
-
* - `separator` — string or `RegExp` used to split a string input into items.
|
|
11
|
-
*
|
|
12
7
|
* @see https://dhoulb.github.io/shelving/schema/ArraySchema/ArraySchemaOptions
|
|
13
8
|
*/
|
|
14
9
|
export interface ArraySchemaOptions<T> extends SchemaOptions {
|
|
15
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Default value used when the input is `undefined`.
|
|
12
|
+
* @default []
|
|
13
|
+
*/
|
|
16
14
|
readonly value?: ImmutableArray;
|
|
17
|
-
/**
|
|
15
|
+
/** Schema every item in the array must conform to. */
|
|
18
16
|
readonly items: Schema<T>;
|
|
19
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Minimum number of items.
|
|
19
|
+
* @default 0
|
|
20
|
+
*/
|
|
20
21
|
readonly min?: number;
|
|
21
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Maximum number of items.
|
|
24
|
+
* @default Number.POSITIVE_INFINITY
|
|
25
|
+
*/
|
|
22
26
|
readonly max?: number;
|
|
23
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Whether to deduplicate the items.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
24
31
|
readonly unique?: boolean;
|
|
25
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* String or `RegExp` used to split a string input into items.
|
|
34
|
+
* @default ","
|
|
35
|
+
*/
|
|
26
36
|
readonly separator?: string | RegExp;
|
|
27
37
|
}
|
|
28
38
|
/**
|
|
@@ -56,8 +66,6 @@ export declare class ArraySchema<T> extends Schema<ImmutableArray<T>> {
|
|
|
56
66
|
readonly separator: string | RegExp;
|
|
57
67
|
/**
|
|
58
68
|
* Create a new `ArraySchema`.
|
|
59
|
-
*
|
|
60
|
-
* @param options Options for the schema, including the `items` schema, `min`/`max` counts, `unique`, and `separator`.
|
|
61
69
|
*/
|
|
62
70
|
constructor({ items, one, many, title, placeholder, unique, min, max, separator, value, ...options }: ArraySchemaOptions<T>);
|
|
63
71
|
/**
|
|
@@ -86,7 +94,6 @@ export declare class ArraySchema<T> extends Schema<ImmutableArray<T>> {
|
|
|
86
94
|
* Sugar factory for [`ArraySchema`](/schema/ArraySchema).
|
|
87
95
|
*
|
|
88
96
|
* @param items Schema every item in the array must conform to.
|
|
89
|
-
* @returns An `ArraySchema` validating arrays of the given item type.
|
|
90
97
|
* @example ARRAY(NUMBER) // ArraySchema<number>
|
|
91
98
|
* @see https://dhoulb.github.io/shelving/schema/ArraySchema/ARRAY
|
|
92
99
|
*/
|
package/schema/ArraySchema.js
CHANGED
|
@@ -32,8 +32,6 @@ export class ArraySchema extends Schema {
|
|
|
32
32
|
separator;
|
|
33
33
|
/**
|
|
34
34
|
* Create a new `ArraySchema`.
|
|
35
|
-
*
|
|
36
|
-
* @param options Options for the schema, including the `items` schema, `min`/`max` counts, `unique`, and `separator`.
|
|
37
35
|
*/
|
|
38
36
|
constructor({ items, one = items.one, many = items.many, title = "Items", placeholder = `No ${many}`, unique = false, min = 0, max = Number.POSITIVE_INFINITY, separator = ",", value = [], ...options }) {
|
|
39
37
|
super({ one, many, title, placeholder, value, ...options });
|
|
@@ -82,7 +80,6 @@ export class ArraySchema extends Schema {
|
|
|
82
80
|
* Sugar factory for [`ArraySchema`](/schema/ArraySchema).
|
|
83
81
|
*
|
|
84
82
|
* @param items Schema every item in the array must conform to.
|
|
85
|
-
* @returns An `ArraySchema` validating arrays of the given item type.
|
|
86
83
|
* @example ARRAY(NUMBER) // ArraySchema<number>
|
|
87
84
|
* @see https://dhoulb.github.io/shelving/schema/ArraySchema/ARRAY
|
|
88
85
|
*/
|
|
@@ -3,13 +3,18 @@ import { Schema } from "./Schema.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Allowed options for `BooleanSchema`.
|
|
5
5
|
*
|
|
6
|
-
* - `value` — default boolean value used when the input is `undefined`.
|
|
7
|
-
* - `required` — when `true`, a falsy result is rejected as invalid.
|
|
8
|
-
*
|
|
9
6
|
* @see https://dhoulb.github.io/shelving/schema/BooleanSchema/BooleanSchemaOptions
|
|
10
7
|
*/
|
|
11
8
|
export interface BooleanSchemaOptions extends SchemaOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Default boolean value used when the input is `undefined`.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
12
13
|
readonly value?: boolean | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* When `true`, a falsy result is rejected as invalid.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
13
18
|
readonly required?: boolean | undefined;
|
|
14
19
|
}
|
|
15
20
|
/**
|
|
@@ -30,10 +35,6 @@ export declare class BooleanSchema extends Schema<boolean> {
|
|
|
30
35
|
readonly required: boolean;
|
|
31
36
|
/**
|
|
32
37
|
* Create a new `BooleanSchema`.
|
|
33
|
-
*
|
|
34
|
-
* @param options Options for the schema.
|
|
35
|
-
* @param options.value Default boolean value used when the input is `undefined` (defaults to `false`).
|
|
36
|
-
* @param options.required When `true`, a falsy result is rejected as invalid (defaults to `false`).
|
|
37
38
|
*/
|
|
38
39
|
constructor({ value, required, ...options }: BooleanSchemaOptions);
|
|
39
40
|
/**
|
package/schema/BooleanSchema.js
CHANGED
|
@@ -17,10 +17,6 @@ const NEGATIVE = ["", "false", "0", "no", "n", "off"];
|
|
|
17
17
|
export class BooleanSchema extends Schema {
|
|
18
18
|
/**
|
|
19
19
|
* Create a new `BooleanSchema`.
|
|
20
|
-
*
|
|
21
|
-
* @param options Options for the schema.
|
|
22
|
-
* @param options.value Default boolean value used when the input is `undefined` (defaults to `false`).
|
|
23
|
-
* @param options.required When `true`, a falsy result is rejected as invalid (defaults to `false`).
|
|
24
20
|
*/
|
|
25
21
|
constructor({ value = false, required = false, ...options }) {
|
|
26
22
|
super({ value, ...options });
|
package/schema/ChoiceSchema.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type PossibleChoiceOptions<K extends string> = ImmutableArray<K> | Choice
|
|
|
26
26
|
*
|
|
27
27
|
* @see https://dhoulb.github.io/shelving/schema/ChoiceSchema/ChoiceSchemaOptions
|
|
28
28
|
*/
|
|
29
|
-
export interface ChoiceSchemaOptions<O extends string, I = never> extends
|
|
29
|
+
export interface ChoiceSchemaOptions<O extends string, I = never> extends SchemaOptions {
|
|
30
30
|
/** Specify correct options using a dictionary of entries. */
|
|
31
31
|
readonly options: PossibleChoiceOptions<O>;
|
|
32
32
|
/** Default option for the value. */
|
|
@@ -49,8 +49,6 @@ export declare class ChoiceSchema<O extends string, I = never> extends Schema<O>
|
|
|
49
49
|
readonly options: ChoiceOptions<O>;
|
|
50
50
|
/**
|
|
51
51
|
* Create a new `ChoiceSchema`.
|
|
52
|
-
*
|
|
53
|
-
* @param options Options for the schema, including the allowed `options` and an optional default `value`.
|
|
54
52
|
*/
|
|
55
53
|
constructor({ one, title, placeholder, options, value, ...rest }: ChoiceSchemaOptions<O, I>);
|
|
56
54
|
/**
|
|
@@ -79,7 +77,6 @@ export declare class ChoiceSchema<O extends string, I = never> extends Schema<O>
|
|
|
79
77
|
* Sugar factory for [`ChoiceSchema`](/schema/ChoiceSchema).
|
|
80
78
|
*
|
|
81
79
|
* @param options The allowed choices, as a `{ key: title }` dictionary or an array of keys.
|
|
82
|
-
* @returns A `ChoiceSchema` validating the given choices.
|
|
83
80
|
* @example CHOICE({ yes: "Yes", no: "No" }) // ChoiceSchema<"yes" | "no">
|
|
84
81
|
* @see https://dhoulb.github.io/shelving/schema/ChoiceSchema/CHOICE
|
|
85
82
|
*/
|
package/schema/ChoiceSchema.js
CHANGED
|
@@ -24,8 +24,6 @@ export class ChoiceSchema extends Schema {
|
|
|
24
24
|
options;
|
|
25
25
|
/**
|
|
26
26
|
* Create a new `ChoiceSchema`.
|
|
27
|
-
*
|
|
28
|
-
* @param options Options for the schema, including the allowed `options` and an optional default `value`.
|
|
29
27
|
*/
|
|
30
28
|
constructor({ one = "choice", title = "Choice", placeholder = `No ${one}`, options, value, ...rest }) {
|
|
31
29
|
super({ one, title, value, placeholder, ...rest });
|
|
@@ -63,7 +61,6 @@ export class ChoiceSchema extends Schema {
|
|
|
63
61
|
* Sugar factory for [`ChoiceSchema`](/schema/ChoiceSchema).
|
|
64
62
|
*
|
|
65
63
|
* @param options The allowed choices, as a `{ key: title }` dictionary or an array of keys.
|
|
66
|
-
* @returns A `ChoiceSchema` validating the given choices.
|
|
67
64
|
* @example CHOICE({ yes: "Yes", no: "No" }) // ChoiceSchema<"yes" | "no">
|
|
68
65
|
* @see https://dhoulb.github.io/shelving/schema/ChoiceSchema/CHOICE
|
|
69
66
|
*/
|