@warp-drive/utilities 5.6.0-alpha.15 → 5.6.0-alpha.17

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 (73) hide show
  1. package/declarations/-private/active-record/find-record.d.ts +59 -60
  2. package/declarations/-private/active-record/query.d.ts +50 -51
  3. package/declarations/-private/active-record/save-record.d.ts +136 -134
  4. package/declarations/-private/builder-utils.d.ts +2 -3
  5. package/declarations/-private/handlers/auto-compress.d.ts +142 -143
  6. package/declarations/-private/handlers/gated.d.ts +12 -13
  7. package/declarations/-private/handlers/utils.d.ts +22 -23
  8. package/declarations/-private/json-api/-utils.d.ts +96 -97
  9. package/declarations/-private/json-api/find-record.d.ts +59 -60
  10. package/declarations/-private/json-api/query.d.ts +97 -98
  11. package/declarations/-private/json-api/save-record.d.ts +180 -178
  12. package/declarations/-private/json-api/serialize.d.ts +43 -44
  13. package/declarations/-private/rest/find-record.d.ts +59 -60
  14. package/declarations/-private/rest/query.d.ts +50 -51
  15. package/declarations/-private/rest/save-record.d.ts +136 -134
  16. package/declarations/-private/string/inflect.d.ts +60 -83
  17. package/declarations/-private/string/inflections.d.ts +4 -5
  18. package/declarations/-private/string/transform.d.ts +68 -80
  19. package/declarations/-private.d.ts +1 -2
  20. package/declarations/active-record.d.ts +3 -4
  21. package/declarations/handlers.d.ts +8 -9
  22. package/declarations/index.d.ts +180 -182
  23. package/declarations/json-api.d.ts +5 -6
  24. package/declarations/rest.d.ts +3 -4
  25. package/declarations/string.d.ts +13 -14
  26. package/dist/active-record.js +1 -1
  27. package/dist/{inflect-Dr20y6b1.js → inflect-BSG696t-.js} +0 -32
  28. package/dist/json-api.js +1 -1
  29. package/dist/rest.js +1 -1
  30. package/dist/string.cjs +0 -33
  31. package/dist/string.js +1 -1
  32. package/package.json +5 -5
  33. package/declarations/-private/active-record/find-record.d.ts.map +0 -1
  34. package/declarations/-private/active-record/query.d.ts.map +0 -1
  35. package/declarations/-private/active-record/save-record.d.ts.map +0 -1
  36. package/declarations/-private/builder-utils.d.ts.map +0 -1
  37. package/declarations/-private/derivations.d.ts +0 -23
  38. package/declarations/-private/derivations.d.ts.map +0 -1
  39. package/declarations/-private/handlers/auto-compress.d.ts.map +0 -1
  40. package/declarations/-private/handlers/gated.d.ts.map +0 -1
  41. package/declarations/-private/handlers/utils.d.ts.map +0 -1
  42. package/declarations/-private/json-api/-utils.d.ts.map +0 -1
  43. package/declarations/-private/json-api/find-record.d.ts.map +0 -1
  44. package/declarations/-private/json-api/find-record.type-test.d.ts +0 -2
  45. package/declarations/-private/json-api/find-record.type-test.d.ts.map +0 -1
  46. package/declarations/-private/json-api/query.d.ts.map +0 -1
  47. package/declarations/-private/json-api/query.type-test.d.ts +0 -2
  48. package/declarations/-private/json-api/query.type-test.d.ts.map +0 -1
  49. package/declarations/-private/json-api/save-record.d.ts.map +0 -1
  50. package/declarations/-private/json-api/serialize.d.ts.map +0 -1
  51. package/declarations/-private/rest/find-record.d.ts.map +0 -1
  52. package/declarations/-private/rest/query.d.ts.map +0 -1
  53. package/declarations/-private/rest/save-record.d.ts.map +0 -1
  54. package/declarations/-private/string/inflect.d.ts.map +0 -1
  55. package/declarations/-private/string/inflections.d.ts.map +0 -1
  56. package/declarations/-private/string/transform.d.ts.map +0 -1
  57. package/declarations/-private.d.ts.map +0 -1
  58. package/declarations/active-record.d.ts.map +0 -1
  59. package/declarations/handlers.d.ts.map +0 -1
  60. package/declarations/index.d.ts.map +0 -1
  61. package/declarations/json-api.d.ts.map +0 -1
  62. package/declarations/rest.d.ts.map +0 -1
  63. package/declarations/string.d.ts.map +0 -1
  64. package/dist/-private.js.map +0 -1
  65. package/dist/active-record.js.map +0 -1
  66. package/dist/builder-utils-Donkk-BZ.js.map +0 -1
  67. package/dist/handlers.js.map +0 -1
  68. package/dist/index.js.map +0 -1
  69. package/dist/inflect-Dr20y6b1.js.map +0 -1
  70. package/dist/json-api.js.map +0 -1
  71. package/dist/rest.js.map +0 -1
  72. package/dist/string.cjs.map +0 -1
  73. package/dist/string.js.map +0 -1
@@ -1,54 +1,53 @@
1
- import type { QueryParamsSource } from '@warp-drive/core/types/params';
2
- import type { TypeFromInstance } from '@warp-drive/core/types/record';
3
- import type { ConstrainedRequestOptions, QueryRequestOptions } from '@warp-drive/core/types/request';
4
- import type { CollectionResourceDataDocument } from '@warp-drive/core/types/spec/document';
1
+ import type { QueryParamsSource } from "@warp-drive/core/types/params";
2
+ import type { TypeFromInstance } from "@warp-drive/core/types/record";
3
+ import type { ConstrainedRequestOptions, QueryRequestOptions } from "@warp-drive/core/types/request";
4
+ import type { CollectionResourceDataDocument } from "@warp-drive/core/types/spec/document";
5
5
  /**
6
- * Builds request options to query for resources, usually by a primary
7
- * type, configured for the url and header expectations of most REST APIs.
8
- *
9
- * **Basic Usage**
10
- *
11
- * ```ts
12
- * import { query } from '@warp-drive/utilities/rest';
13
- *
14
- * const data = await store.request(query('person'));
15
- * ```
16
- *
17
- * **With Query Params**
18
- *
19
- * ```ts
20
- * import { query } from '@warp-drive/utilities/rest';
21
- *
22
- * const options = query('person', { include: ['pets', 'friends'] });
23
- * const data = await store.request(options);
24
- * ```
25
- *
26
- * **Supplying Options to Modify the Request Behavior**
27
- *
28
- * The following options are supported:
29
- *
30
- * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
31
- * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
32
- * - `resourcePath` - The resource path to use for the request, defaults to pluralizing and camelCasing the supplied type
33
- * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
34
- * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
35
- * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
36
- * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
37
- * defaulting to `false` if none is configured.
38
- * - `urlParamsSettings` - an object containing options for how to serialize the query params (see `buildQueryParams`)
39
- *
40
- * ```ts
41
- * import { query } from '@warp-drive/utilities/rest';
42
- *
43
- * const options = query('person', { include: ['pets', 'friends'] }, { reload: true });
44
- * const data = await store.request(options);
45
- * ```
46
- *
47
- * @public
48
- * @param identifier
49
- * @param query
50
- * @param options
51
- */
6
+ * Builds request options to query for resources, usually by a primary
7
+ * type, configured for the url and header expectations of most REST APIs.
8
+ *
9
+ * **Basic Usage**
10
+ *
11
+ * ```ts
12
+ * import { query } from '@warp-drive/utilities/rest';
13
+ *
14
+ * const data = await store.request(query('person'));
15
+ * ```
16
+ *
17
+ * **With Query Params**
18
+ *
19
+ * ```ts
20
+ * import { query } from '@warp-drive/utilities/rest';
21
+ *
22
+ * const options = query('person', { include: ['pets', 'friends'] });
23
+ * const data = await store.request(options);
24
+ * ```
25
+ *
26
+ * **Supplying Options to Modify the Request Behavior**
27
+ *
28
+ * The following options are supported:
29
+ *
30
+ * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
31
+ * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
32
+ * - `resourcePath` - The resource path to use for the request, defaults to pluralizing and camelCasing the supplied type
33
+ * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
34
+ * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
35
+ * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
36
+ * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
37
+ * defaulting to `false` if none is configured.
38
+ * - `urlParamsSettings` - an object containing options for how to serialize the query params (see `buildQueryParams`)
39
+ *
40
+ * ```ts
41
+ * import { query } from '@warp-drive/utilities/rest';
42
+ *
43
+ * const options = query('person', { include: ['pets', 'friends'] }, { reload: true });
44
+ * const data = await store.request(options);
45
+ * ```
46
+ *
47
+ * @public
48
+ * @param identifier
49
+ * @param query
50
+ * @param options
51
+ */
52
52
  export declare function query<T>(type: TypeFromInstance<T>, query?: QueryParamsSource, options?: ConstrainedRequestOptions): QueryRequestOptions<CollectionResourceDataDocument<T>, T>;
53
53
  export declare function query(type: string, query?: QueryParamsSource, options?: ConstrainedRequestOptions): QueryRequestOptions;
54
- //# sourceMappingURL=query.d.ts.map
@@ -1,144 +1,146 @@
1
- import type { TypedRecordInstance } from '@warp-drive/core/types/record';
2
- import type { ConstrainedRequestOptions, CreateRequestOptions, DeleteRequestOptions, UpdateRequestOptions } from '@warp-drive/core/types/request';
3
- import type { SingleResourceDataDocument } from '@warp-drive/core/types/spec/document';
1
+ import type { TypedRecordInstance } from "@warp-drive/core/types/record";
2
+ import type { ConstrainedRequestOptions, CreateRequestOptions, DeleteRequestOptions, UpdateRequestOptions } from "@warp-drive/core/types/request";
3
+ import type { SingleResourceDataDocument } from "@warp-drive/core/types/spec/document";
4
4
  /**
5
- * Builds request options to delete record for resources,
6
- * configured for the url, method and header expectations of REST APIs.
7
- *
8
- * **Basic Usage**
9
- *
10
- * ```ts
11
- * import { deleteRecord } from '@warp-drive/utilities/rest';
12
- *
13
- * const person = store.peekRecord('person', '1');
14
- *
15
- * // mark record as deleted
16
- * store.deleteRecord(person);
17
- *
18
- * // persist deletion
19
- * const data = await store.request(deleteRecord(person));
20
- * ```
21
- *
22
- * **Supplying Options to Modify the Request Behavior**
23
- *
24
- * The following options are supported:
25
- *
26
- * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
27
- * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
28
- * - `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type
29
- * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
30
- * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
31
- * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
32
- * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
33
- * defaulting to `false` if none is configured.
34
- * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
35
- *
36
- * ```ts
37
- * import { deleteRecord } from '@warp-drive/utilities/rest';
38
- *
39
- * const person = store.peekRecord('person', '1');
40
- *
41
- * // mark record as deleted
42
- * store.deleteRecord(person);
43
- *
44
- * // persist deletion
45
- * const options = deleteRecord(person, { namespace: 'api/v1' });
46
- * const data = await store.request(options);
47
- * ```
48
- *
49
- * @public
50
- * @param record
51
- * @param options
52
- */
5
+ * Builds request options to delete record for resources,
6
+ * configured for the url, method and header expectations of REST APIs.
7
+ *
8
+ * **Basic Usage**
9
+ *
10
+ * ```ts
11
+ * import { deleteRecord } from '@warp-drive/utilities/rest';
12
+ *
13
+ * const person = store.peekRecord('person', '1');
14
+ *
15
+ * // mark record as deleted
16
+ * store.deleteRecord(person);
17
+ *
18
+ * // persist deletion
19
+ * const data = await store.request(deleteRecord(person));
20
+ * ```
21
+ *
22
+ * **Supplying Options to Modify the Request Behavior**
23
+ *
24
+ * The following options are supported:
25
+ *
26
+ * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
27
+ * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
28
+ * - `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type
29
+ * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
30
+ * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
31
+ * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
32
+ * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
33
+ * defaulting to `false` if none is configured.
34
+ * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
35
+ *
36
+ * ```ts
37
+ * import { deleteRecord } from '@warp-drive/utilities/rest';
38
+ *
39
+ * const person = store.peekRecord('person', '1');
40
+ *
41
+ * // mark record as deleted
42
+ * store.deleteRecord(person);
43
+ *
44
+ * // persist deletion
45
+ * const options = deleteRecord(person, { namespace: 'api/v1' });
46
+ * const data = await store.request(options);
47
+ * ```
48
+ *
49
+ * @public
50
+ * @param record
51
+ * @param options
52
+ */
53
53
  export declare function deleteRecord<T>(record: T, options?: ConstrainedRequestOptions): DeleteRequestOptions<T>;
54
54
  export declare function deleteRecord(record: unknown, options?: ConstrainedRequestOptions): DeleteRequestOptions;
55
55
  /**
56
- * Builds request options to create new record for resources,
57
- * configured for the url, method and header expectations of most REST APIs.
58
- *
59
- * **Basic Usage**
60
- *
61
- * ```ts
62
- * import { createRecord } from '@warp-drive/utilities/rest';
63
- *
64
- * const person = store.createRecord('person', { name: 'Ted' });
65
- * const data = await store.request(createRecord(person));
66
- * ```
67
- *
68
- * **Supplying Options to Modify the Request Behavior**
69
- *
70
- * The following options are supported:
71
- *
72
- * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
73
- * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
74
- * - `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type
75
- * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
76
- * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
77
- * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
78
- * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
79
- * defaulting to `false` if none is configured.
80
- * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
81
- *
82
- * ```ts
83
- * import { createRecord } from '@warp-drive/utilities/rest';
84
- *
85
- * const person = store.createRecord('person', { name: 'Ted' });
86
- * const options = createRecord(person, { namespace: 'api/v1' });
87
- * const data = await store.request(options);
88
- * ```
89
- *
90
- * @public
91
- * @param record
92
- * @param options
93
- */
56
+ * Builds request options to create new record for resources,
57
+ * configured for the url, method and header expectations of most REST APIs.
58
+ *
59
+ * **Basic Usage**
60
+ *
61
+ * ```ts
62
+ * import { createRecord } from '@warp-drive/utilities/rest';
63
+ *
64
+ * const person = store.createRecord('person', { name: 'Ted' });
65
+ * const data = await store.request(createRecord(person));
66
+ * ```
67
+ *
68
+ * **Supplying Options to Modify the Request Behavior**
69
+ *
70
+ * The following options are supported:
71
+ *
72
+ * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
73
+ * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
74
+ * - `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type
75
+ * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
76
+ * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
77
+ * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
78
+ * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
79
+ * defaulting to `false` if none is configured.
80
+ * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
81
+ *
82
+ * ```ts
83
+ * import { createRecord } from '@warp-drive/utilities/rest';
84
+ *
85
+ * const person = store.createRecord('person', { name: 'Ted' });
86
+ * const options = createRecord(person, { namespace: 'api/v1' });
87
+ * const data = await store.request(options);
88
+ * ```
89
+ *
90
+ * @public
91
+ * @param record
92
+ * @param options
93
+ */
94
94
  export declare function createRecord<T>(record: T, options?: ConstrainedRequestOptions): CreateRequestOptions<T>;
95
95
  export declare function createRecord(record: unknown, options?: ConstrainedRequestOptions): CreateRequestOptions;
96
96
  /**
97
- * Builds request options to update existing record for resources,
98
- * configured for the url, method and header expectations of most REST APIs.
99
- *
100
- * **Basic Usage**
101
- *
102
- * ```ts
103
- * import { updateRecord } from '@warp-drive/utilities/rest';
104
- *
105
- * const person = store.peekRecord('person', '1');
106
- * person.name = 'Chris';
107
- * const data = await store.request(updateRecord(person));
108
- * ```
109
- *
110
- * **Supplying Options to Modify the Request Behavior**
111
- *
112
- * The following options are supported:
113
- *
114
- * - `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.
115
- * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
116
- * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
117
- * - `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type
118
- * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
119
- * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
120
- * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
121
- * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
122
- * defaulting to `false` if none is configured.
123
- * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
124
- *
125
- * ```ts
126
- * import { updateRecord } from '@warp-drive/utilities/rest';
127
- *
128
- * const person = store.peekRecord('person', '1');
129
- * person.name = 'Chris';
130
- * const options = updateRecord(person, { patch: true });
131
- * const data = await store.request(options);
132
- * ```
133
- *
134
- * @public
135
- * @param record
136
- * @param options
137
- */
138
- export declare function updateRecord<T extends TypedRecordInstance, RT extends TypedRecordInstance = T>(record: T, options?: ConstrainedRequestOptions & {
139
- patch?: boolean;
97
+ * Builds request options to update existing record for resources,
98
+ * configured for the url, method and header expectations of most REST APIs.
99
+ *
100
+ * **Basic Usage**
101
+ *
102
+ * ```ts
103
+ * import { updateRecord } from '@warp-drive/utilities/rest';
104
+ *
105
+ * const person = store.peekRecord('person', '1');
106
+ * person.name = 'Chris';
107
+ * const data = await store.request(updateRecord(person));
108
+ * ```
109
+ *
110
+ * **Supplying Options to Modify the Request Behavior**
111
+ *
112
+ * The following options are supported:
113
+ *
114
+ * - `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.
115
+ * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
116
+ * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
117
+ * - `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type
118
+ * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
119
+ * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
120
+ * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
121
+ * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
122
+ * defaulting to `false` if none is configured.
123
+ * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
124
+ *
125
+ * ```ts
126
+ * import { updateRecord } from '@warp-drive/utilities/rest';
127
+ *
128
+ * const person = store.peekRecord('person', '1');
129
+ * person.name = 'Chris';
130
+ * const options = updateRecord(person, { patch: true });
131
+ * const data = await store.request(options);
132
+ * ```
133
+ *
134
+ * @public
135
+ * @param record
136
+ * @param options
137
+ */
138
+ export declare function updateRecord<
139
+ T extends TypedRecordInstance,
140
+ RT extends TypedRecordInstance = T
141
+ >(record: T, options?: ConstrainedRequestOptions & {
142
+ patch?: boolean;
140
143
  }): UpdateRequestOptions<SingleResourceDataDocument<RT>, T>;
141
144
  export declare function updateRecord(record: unknown, options?: ConstrainedRequestOptions & {
142
- patch?: boolean;
145
+ patch?: boolean;
143
146
  }): UpdateRequestOptions;
144
- //# sourceMappingURL=save-record.d.ts.map
@@ -1,105 +1,82 @@
1
1
  /**
2
- * Marks a word as uncountable. Uncountable words are not pluralized
3
- * or singularized.
4
- *
5
- * @public
6
- * @param {String} word
7
- * @return {void}
8
- * @since 4.13.0
9
- */
2
+ * Marks a word as uncountable. Uncountable words are not pluralized
3
+ * or singularized.
4
+ *
5
+ * @public
6
+ * @since 4.13.0
7
+ */
10
8
  export declare function uncountable(word: string): void;
11
9
  /**
12
- * Marks a list of words as uncountable. Uncountable words are not pluralized
13
- * or singularized.
14
- *
15
- * @public
16
- * @param {Array<String>} uncountables
17
- * @return {void}
18
- * @since 4.13.0
19
- */
10
+ * Marks a list of words as uncountable. Uncountable words are not pluralized
11
+ * or singularized.
12
+ *
13
+ * @public
14
+ * @since 4.13.0
15
+ */
20
16
  export declare function loadUncountable(uncountables: string[]): void;
21
17
  /**
22
- * Marks a word as irregular. Irregular words have unique
23
- * pluralization and singularization rules.
24
- *
25
- * @public
26
- * @param {String} single
27
- * @param {String} plur
28
- * @return {void}
29
- * @since 4.13.0
30
- */
18
+ * Marks a word as irregular. Irregular words have unique
19
+ * pluralization and singularization rules.
20
+ *
21
+ * @public
22
+ * @since 4.13.0
23
+ */
31
24
  export declare function irregular(single: string, plur: string): void;
32
25
  /**
33
- * Marks a list of word pairs as irregular. Irregular words have unique
34
- * pluralization and singularization rules.
35
- *
36
- * @public
37
- * @param {Array<Array<String>>} irregularPairs
38
- * @return {void}
39
- * @since 4.13.0
40
- */
26
+ * Marks a list of word pairs as irregular. Irregular words have unique
27
+ * pluralization and singularization rules.
28
+ *
29
+ * @public
30
+ * @since 4.13.0
31
+ */
41
32
  export declare function loadIrregular(irregularPairs: Array<[string, string]>): void;
42
33
  /**
43
- * Clears the caches for singularize and pluralize.
44
- *
45
- * @public
46
- * @return {void}
47
- * @since 4.13.0
48
- */
34
+ * Clears the caches for singularize and pluralize.
35
+ *
36
+ * @public
37
+ * @since 4.13.0
38
+ */
49
39
  export declare function clear(): void;
50
40
  /**
51
- * Resets the inflection rules to the defaults.
52
- *
53
- * @public
54
- * @return {void}
55
- * @since 4.13.0
56
- */
41
+ * Resets the inflection rules to the defaults.
42
+ *
43
+ * @public
44
+ * @since 4.13.0
45
+ */
57
46
  export declare function resetToDefaults(): void;
58
47
  /**
59
- * Clears all inflection rules
60
- * and resets the caches for singularize and pluralize.
61
- *
62
- * @public
63
- * @return {void}
64
- * @since 4.13.0
65
- */
48
+ * Clears all inflection rules
49
+ * and resets the caches for singularize and pluralize.
50
+ *
51
+ * @public
52
+ * @since 4.13.0
53
+ */
66
54
  export declare function clearRules(): void;
67
55
  /**
68
- * Singularizes a word.
69
- *
70
- * @public
71
- * @param {String} word
72
- * @return {String}
73
- * @since 4.13.0
74
- */
56
+ * Singularizes a word.
57
+ *
58
+ * @public
59
+ * @since 4.13.0
60
+ */
75
61
  export declare function singularize(word: string): string;
76
62
  /**
77
- * Pluralizes a word.
78
- *
79
- * @public
80
- * @param {String} word
81
- * @return {String}
82
- * @since 4.13.0
83
- */
63
+ * Pluralizes a word.
64
+ *
65
+ * @public
66
+ * @since 4.13.0
67
+ */
84
68
  export declare function pluralize(word: string): string;
85
69
  /**
86
- * Adds a pluralization rule.
87
- *
88
- * @public
89
- * @param {RegExp} regex
90
- * @param {String} string
91
- * @return {void}
92
- * @since 4.13.0
93
- */
70
+ * Adds a pluralization rule.
71
+ *
72
+ * @public
73
+ * @since 4.13.0
74
+ */
94
75
  export declare function plural(regex: RegExp, string: string): void;
95
76
  /**
96
- * Adds a singularization rule.
97
- *
98
- * @public
99
- * @param {RegExp} regex
100
- * @param {String} string
101
- * @return {void}
102
- * @since 4.13.0
103
- */
77
+ * Adds a singularization rule.
78
+ *
79
+ * @public
80
+ * @since 4.13.0
81
+ */
104
82
  export declare function singular(regex: RegExp, string: string): void;
105
- //# sourceMappingURL=inflect.d.ts.map
@@ -1,10 +1,9 @@
1
1
  export type RulesArray = Array<[RegExp, string]>;
2
2
  type DefaultRulesType = {
3
- plurals: RulesArray;
4
- singular: RulesArray;
5
- irregularPairs: Array<[string, string]>;
6
- uncountable: string[];
3
+ plurals: RulesArray;
4
+ singular: RulesArray;
5
+ irregularPairs: Array<[string, string]>;
6
+ uncountable: string[];
7
7
  };
8
8
  export declare const defaultRules: DefaultRulesType;
9
9
  export {};
10
- //# sourceMappingURL=inflections.d.ts.map