@types/govuk-frontend 5.11.0 → 6.0.0
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.
- govuk-frontend/README.md +1 -1
- govuk-frontend/dist/govuk/all.bundle.d.mts +0 -1
- govuk-frontend/dist/govuk/all.bundle.d.ts +0 -2
- govuk-frontend/dist/govuk/common/configuration.d.ts +4 -10
- govuk-frontend/dist/govuk/i18n.d.ts +0 -79
- govuk-frontend/package.json +7 -3
- govuk-frontend/dist/govuk/components/header/header.d.mts +0 -1
- govuk-frontend/dist/govuk/components/header/header.d.ts +0 -19
govuk-frontend/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for govuk-frontend (https://github.com/al
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/govuk-frontend.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Wed, 23 Sep 2026 16:37:51 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -9,7 +9,6 @@ export { Checkboxes } from "./components/checkboxes/checkboxes.mjs";
|
|
|
9
9
|
export { ErrorSummary } from "./components/error-summary/error-summary.mjs";
|
|
10
10
|
export { ExitThisPage } from "./components/exit-this-page/exit-this-page.mjs";
|
|
11
11
|
export { FileUpload } from "./components/file-upload/file-upload.mjs";
|
|
12
|
-
export { Header } from "./components/header/header.mjs";
|
|
13
12
|
export { NotificationBanner } from "./components/notification-banner/notification-banner.mjs";
|
|
14
13
|
export { PasswordInput } from "./components/password-input/password-input.mjs";
|
|
15
14
|
export { Radios } from "./components/radios/radios.mjs";
|
|
@@ -9,7 +9,6 @@ import { Checkboxes } from "./components/checkboxes/checkboxes.js";
|
|
|
9
9
|
import { ErrorSummary } from "./components/error-summary/error-summary.js";
|
|
10
10
|
import { ExitThisPage } from "./components/exit-this-page/exit-this-page.js";
|
|
11
11
|
import { FileUpload } from "./components/file-upload/file-upload.js";
|
|
12
|
-
import { Header } from "./components/header/header.js";
|
|
13
12
|
import { NotificationBanner } from "./components/notification-banner/notification-banner.js";
|
|
14
13
|
import { PasswordInput } from "./components/password-input/password-input.js";
|
|
15
14
|
import { Radios } from "./components/radios/radios.js";
|
|
@@ -33,7 +32,6 @@ declare const GOVUKFrontend: {
|
|
|
33
32
|
ErrorSummary: typeof ErrorSummary;
|
|
34
33
|
ExitThisPage: typeof ExitThisPage;
|
|
35
34
|
FileUpload: typeof FileUpload;
|
|
36
|
-
Header: typeof Header;
|
|
37
35
|
NotificationBanner: typeof NotificationBanner;
|
|
38
36
|
PasswordInput: typeof PasswordInput;
|
|
39
37
|
Radios: typeof Radios;
|
|
@@ -30,7 +30,6 @@ export function normaliseString(
|
|
|
30
30
|
*
|
|
31
31
|
* @internal
|
|
32
32
|
* @template {Partial<Record<keyof ConfigurationType, unknown>>} ConfigurationType
|
|
33
|
-
* @template {[keyof ConfigurationType, SchemaProperty | undefined][]} SchemaEntryType
|
|
34
33
|
* @param {{ schema?: Schema<ConfigurationType>, moduleName: string }} Component - Component class
|
|
35
34
|
* @param {DOMStringMap} dataset - HTML element dataset
|
|
36
35
|
* @returns {ObjectNested} Normalised dataset
|
|
@@ -53,9 +52,7 @@ export function normaliseDataset<
|
|
|
53
52
|
* @param {Config | CreateAllOptions<ComponentClass> | OnErrorCallback<ComponentClass> | Element | Document | null} [scopeOrOptions] - Scope of the document to search within, initialisation options or error callback function
|
|
54
53
|
* @returns {CreateAllOptions<ComponentClass>} Normalised options
|
|
55
54
|
*/
|
|
56
|
-
export function normaliseOptions<
|
|
57
|
-
ComponentClass extends CompatibleClass,
|
|
58
|
-
>(
|
|
55
|
+
export function normaliseOptions<ComponentClass extends CompatibleClass>(
|
|
59
56
|
scopeOrOptions?:
|
|
60
57
|
| Config
|
|
61
58
|
| CreateAllOptions<ComponentClass>
|
|
@@ -126,13 +123,11 @@ export const configOverride: unique symbol;
|
|
|
126
123
|
*
|
|
127
124
|
* Centralises the behaviours shared by our components
|
|
128
125
|
*
|
|
129
|
-
* @template {Partial<Record<keyof ConfigurationType, unknown>>} ConfigurationType
|
|
130
|
-
* @template {Element & { dataset: DOMStringMap }} RootElementType
|
|
126
|
+
* @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]
|
|
127
|
+
* @template {Element & { dataset: DOMStringMap }} [RootElementType=HTMLElement]
|
|
131
128
|
*/
|
|
132
129
|
export abstract class ConfigurableComponent<
|
|
133
|
-
ConfigurationType extends Partial<
|
|
134
|
-
Record<keyof ConfigurationType, unknown>
|
|
135
|
-
> = ObjectNested,
|
|
130
|
+
ConfigurationType extends Partial<Record<keyof ConfigurationType, unknown>> = ObjectNested,
|
|
136
131
|
RootElementType extends Element & {
|
|
137
132
|
dataset: DOMStringMap;
|
|
138
133
|
} = HTMLElement,
|
|
@@ -153,7 +148,6 @@ export abstract class ConfigurableComponent<
|
|
|
153
148
|
*/
|
|
154
149
|
protected get config(): ConfigurationType;
|
|
155
150
|
|
|
156
|
-
/** */
|
|
157
151
|
_config: ConfigurationType;
|
|
158
152
|
|
|
159
153
|
/**
|
|
@@ -5,59 +5,6 @@
|
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
7
|
export class I18n {
|
|
8
|
-
/**
|
|
9
|
-
* Map of plural rules to languages where those rules apply.
|
|
10
|
-
*
|
|
11
|
-
* Note: These groups are named for the most dominant or recognisable language
|
|
12
|
-
* that uses each system. The groupings do not imply that the languages are
|
|
13
|
-
* related to one another. Many languages have evolved the same systems
|
|
14
|
-
* independently of one another.
|
|
15
|
-
*
|
|
16
|
-
* Code to support more languages can be found in the i18n spike:
|
|
17
|
-
* {@link https://github.com/alphagov/govuk-frontend/blob/spike-i18n-support/src/govuk/i18n.mjs}
|
|
18
|
-
*
|
|
19
|
-
* Languages currently supported:
|
|
20
|
-
*
|
|
21
|
-
* Arabic: Arabic (ar)
|
|
22
|
-
* Chinese: Burmese (my), Chinese (zh), Indonesian (id), Japanese (ja),
|
|
23
|
-
* Javanese (jv), Korean (ko), Malay (ms), Thai (th), Vietnamese (vi)
|
|
24
|
-
* French: Armenian (hy), Bangla (bn), French (fr), Gujarati (gu), Hindi (hi),
|
|
25
|
-
* Persian Farsi (fa), Punjabi (pa), Zulu (zu)
|
|
26
|
-
* German: Afrikaans (af), Albanian (sq), Azerbaijani (az), Basque (eu),
|
|
27
|
-
* Bulgarian (bg), Catalan (ca), Danish (da), Dutch (nl), English (en),
|
|
28
|
-
* Estonian (et), Finnish (fi), Georgian (ka), German (de), Greek (el),
|
|
29
|
-
* Hungarian (hu), Luxembourgish (lb), Norwegian (no), Somali (so),
|
|
30
|
-
* Swahili (sw), Swedish (sv), Tamil (ta), Telugu (te), Turkish (tr),
|
|
31
|
-
* Urdu (ur)
|
|
32
|
-
* Irish: Irish Gaelic (ga)
|
|
33
|
-
* Russian: Russian (ru), Ukrainian (uk)
|
|
34
|
-
* Scottish: Scottish Gaelic (gd)
|
|
35
|
-
* Spanish: European Portuguese (pt-PT), Italian (it), Spanish (es)
|
|
36
|
-
* Welsh: Welsh (cy)
|
|
37
|
-
*
|
|
38
|
-
* @internal
|
|
39
|
-
*/
|
|
40
|
-
static pluralRulesMap: {
|
|
41
|
-
[key: string]: string[];
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Different pluralisation rule sets
|
|
46
|
-
*
|
|
47
|
-
* Returns the appropriate suffix for the plural form associated with `n`.
|
|
48
|
-
* Possible suffixes: 'zero', 'one', 'two', 'few', 'many', 'other' (the actual
|
|
49
|
-
* meaning of each differs per locale). 'other' should always exist, even in
|
|
50
|
-
* languages without plurals, such as Chinese.
|
|
51
|
-
* {@link https://cldr.unicode.org/index/cldr-spec/plural-rules}
|
|
52
|
-
*
|
|
53
|
-
* The count must be a positive integer. Negative numbers and decimals aren't accounted for
|
|
54
|
-
*
|
|
55
|
-
* @internal
|
|
56
|
-
*/
|
|
57
|
-
static pluralRules: {
|
|
58
|
-
[key: string]: (count: number) => PluralRule;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
8
|
/**
|
|
62
9
|
* @internal
|
|
63
10
|
* @param {{ [key: string]: string | TranslationPluralForms }} translations - Key-value pairs of the translation strings to use.
|
|
@@ -142,32 +89,6 @@ export class I18n {
|
|
|
142
89
|
* @throws {Error} Plural form `.other` required when preferred plural form is missing
|
|
143
90
|
*/
|
|
144
91
|
getPluralSuffix(lookupKey: string, count: number): PluralRule;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Get the plural form using our fallback implementation
|
|
148
|
-
*
|
|
149
|
-
* This is split out into a separate function to make it easier to test the
|
|
150
|
-
* fallback behaviour in an environment where Intl.PluralRules exists.
|
|
151
|
-
*
|
|
152
|
-
* @internal
|
|
153
|
-
* @param {number} count - Number used to determine which pluralisation to use.
|
|
154
|
-
* @returns {PluralRule} The pluralisation form for count in this locale.
|
|
155
|
-
*/
|
|
156
|
-
selectPluralFormUsingFallbackRules(count: number): PluralRule;
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Work out which pluralisation rules to use for the current locale
|
|
160
|
-
*
|
|
161
|
-
* The locale may include a regional indicator (such as en-GB), but we don't
|
|
162
|
-
* usually care about this part, as pluralisation rules are usually the same
|
|
163
|
-
* regardless of region. There are exceptions, however, (e.g. Portuguese) so
|
|
164
|
-
* this searches by both the full and shortened locale codes, just to be sure.
|
|
165
|
-
*
|
|
166
|
-
* @internal
|
|
167
|
-
* @returns {string | undefined} The name of the pluralisation rule to use (a key for one
|
|
168
|
-
* of the functions in this.pluralRules)
|
|
169
|
-
*/
|
|
170
|
-
getPluralRulesForLocale(): string | undefined;
|
|
171
92
|
}
|
|
172
93
|
|
|
173
94
|
/**
|
govuk-frontend/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/govuk-frontend",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "TypeScript definitions for govuk-frontend",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/govuk-frontend",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"import": "./dist/govuk/all.d.mts",
|
|
29
29
|
"require": "./dist/govuk/all.bundle.d.ts"
|
|
30
30
|
},
|
|
31
|
+
"./*": {
|
|
32
|
+
"require": "./*",
|
|
33
|
+
"import": "./*"
|
|
34
|
+
},
|
|
31
35
|
"./package.json": "./package.json"
|
|
32
36
|
},
|
|
33
37
|
"repository": {
|
|
@@ -38,6 +42,6 @@
|
|
|
38
42
|
"scripts": {},
|
|
39
43
|
"dependencies": {},
|
|
40
44
|
"peerDependencies": {},
|
|
41
|
-
"typesPublisherContentHash": "
|
|
42
|
-
"typeScriptVersion": "5.
|
|
45
|
+
"typesPublisherContentHash": "58d3ca8635f37a815bde43b3eeef3e159f7737e3024945834eee477cb83b7cb4",
|
|
46
|
+
"typeScriptVersion": "5.6"
|
|
43
47
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./header.js";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Component } from "../../component.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Header component
|
|
5
|
-
*/
|
|
6
|
-
export class Header extends Component<HTMLElement> {
|
|
7
|
-
/**
|
|
8
|
-
* Name for the component used when initialising using data-module attributes.
|
|
9
|
-
*/
|
|
10
|
-
static moduleName: string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Apply a matchMedia for desktop which will trigger a state sync if the
|
|
14
|
-
* browser viewport moves between states.
|
|
15
|
-
*
|
|
16
|
-
* @param {Element | null} $root - HTML element to use for header
|
|
17
|
-
*/
|
|
18
|
-
constructor($root: Element | null);
|
|
19
|
-
}
|