@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.
- package/declarations/-private/active-record/find-record.d.ts +59 -60
- package/declarations/-private/active-record/query.d.ts +50 -51
- package/declarations/-private/active-record/save-record.d.ts +136 -134
- package/declarations/-private/builder-utils.d.ts +2 -3
- package/declarations/-private/handlers/auto-compress.d.ts +142 -143
- package/declarations/-private/handlers/gated.d.ts +12 -13
- package/declarations/-private/handlers/utils.d.ts +22 -23
- package/declarations/-private/json-api/-utils.d.ts +96 -97
- package/declarations/-private/json-api/find-record.d.ts +59 -60
- package/declarations/-private/json-api/query.d.ts +97 -98
- package/declarations/-private/json-api/save-record.d.ts +180 -178
- package/declarations/-private/json-api/serialize.d.ts +43 -44
- package/declarations/-private/rest/find-record.d.ts +59 -60
- package/declarations/-private/rest/query.d.ts +50 -51
- package/declarations/-private/rest/save-record.d.ts +136 -134
- package/declarations/-private/string/inflect.d.ts +60 -83
- package/declarations/-private/string/inflections.d.ts +4 -5
- package/declarations/-private/string/transform.d.ts +68 -80
- package/declarations/-private.d.ts +1 -2
- package/declarations/active-record.d.ts +3 -4
- package/declarations/handlers.d.ts +8 -9
- package/declarations/index.d.ts +180 -182
- package/declarations/json-api.d.ts +5 -6
- package/declarations/rest.d.ts +3 -4
- package/declarations/string.d.ts +13 -14
- package/dist/active-record.js +1 -1
- package/dist/{inflect-Dr20y6b1.js → inflect-BSG696t-.js} +0 -32
- package/dist/json-api.js +1 -1
- package/dist/rest.js +1 -1
- package/dist/string.cjs +0 -33
- package/dist/string.js +1 -1
- package/package.json +5 -5
- package/declarations/-private/active-record/find-record.d.ts.map +0 -1
- package/declarations/-private/active-record/query.d.ts.map +0 -1
- package/declarations/-private/active-record/save-record.d.ts.map +0 -1
- package/declarations/-private/builder-utils.d.ts.map +0 -1
- package/declarations/-private/derivations.d.ts +0 -23
- package/declarations/-private/derivations.d.ts.map +0 -1
- package/declarations/-private/handlers/auto-compress.d.ts.map +0 -1
- package/declarations/-private/handlers/gated.d.ts.map +0 -1
- package/declarations/-private/handlers/utils.d.ts.map +0 -1
- package/declarations/-private/json-api/-utils.d.ts.map +0 -1
- package/declarations/-private/json-api/find-record.d.ts.map +0 -1
- package/declarations/-private/json-api/find-record.type-test.d.ts +0 -2
- package/declarations/-private/json-api/find-record.type-test.d.ts.map +0 -1
- package/declarations/-private/json-api/query.d.ts.map +0 -1
- package/declarations/-private/json-api/query.type-test.d.ts +0 -2
- package/declarations/-private/json-api/query.type-test.d.ts.map +0 -1
- package/declarations/-private/json-api/save-record.d.ts.map +0 -1
- package/declarations/-private/json-api/serialize.d.ts.map +0 -1
- package/declarations/-private/rest/find-record.d.ts.map +0 -1
- package/declarations/-private/rest/query.d.ts.map +0 -1
- package/declarations/-private/rest/save-record.d.ts.map +0 -1
- package/declarations/-private/string/inflect.d.ts.map +0 -1
- package/declarations/-private/string/inflections.d.ts.map +0 -1
- package/declarations/-private/string/transform.d.ts.map +0 -1
- package/declarations/-private.d.ts.map +0 -1
- package/declarations/active-record.d.ts.map +0 -1
- package/declarations/handlers.d.ts.map +0 -1
- package/declarations/index.d.ts.map +0 -1
- package/declarations/json-api.d.ts.map +0 -1
- package/declarations/rest.d.ts.map +0 -1
- package/declarations/string.d.ts.map +0 -1
- package/dist/-private.js.map +0 -1
- package/dist/active-record.js.map +0 -1
- package/dist/builder-utils-Donkk-BZ.js.map +0 -1
- package/dist/handlers.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/inflect-Dr20y6b1.js.map +0 -1
- package/dist/json-api.js.map +0 -1
- package/dist/rest.js.map +0 -1
- package/dist/string.cjs.map +0 -1
- package/dist/string.js.map +0 -1
|
@@ -1,54 +1,53 @@
|
|
|
1
|
-
import type { QueryParamsSource } from
|
|
2
|
-
import type { TypeFromInstance } from
|
|
3
|
-
import type { ConstrainedRequestOptions, QueryRequestOptions } from
|
|
4
|
-
import type { CollectionResourceDataDocument } from
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
|
2
|
-
import type { ConstrainedRequestOptions, CreateRequestOptions, DeleteRequestOptions, UpdateRequestOptions } from
|
|
3
|
-
import type { SingleResourceDataDocument } from
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
export declare function updateRecord<
|
|
139
|
-
|
|
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
|
-
|
|
145
|
+
patch?: boolean;
|
|
143
146
|
}): UpdateRequestOptions;
|
|
144
|
-
//# sourceMappingURL=save-record.d.ts.map
|
|
@@ -1,105 +1,82 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|