native-document 1.0.93 → 1.0.94

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/types/forms.d.ts CHANGED
@@ -1,51 +1,88 @@
1
1
  // Form elements type definitions
2
- import { Attributes, ValidChild } from './elements';
3
- import { NDElement} from "./nd-element";
4
- import {ElementFunction} from "./elements";
5
-
6
- // Form Elements
7
- export declare const Form: ElementFunction & {
8
- submit(action: string | ((event: Event) => void)): HTMLFormElement & { nd: NDElement };
9
- multipartFormData(): HTMLFormElement & { nd: NDElement };
10
- post(action: string): HTMLFormElement & { nd: NDElement };
11
- get(action: string): HTMLFormElement & { nd: NDElement };
2
+ import {
3
+ ValidChild,
4
+ ElementFunction,
5
+ ElementFunctionNoChildren,
6
+ NdHTMLElement,
7
+ GlobalAttributes,
8
+ Observable
9
+ } from './elements';
10
+ import {
11
+ FormAttributes,
12
+ InputAttributes,
13
+ TextAreaAttributes,
14
+ SelectAttributes,
15
+ OptionAttributes,
16
+ ButtonAttributes,
17
+ OutputAttributes,
18
+ ProgressAttributes,
19
+ MeterAttributes,
20
+ LabelAttributes,
21
+ } from './elements';
22
+
23
+ // ─────────────────────────────────────────────
24
+ // Form
25
+ // ─────────────────────────────────────────────
26
+
27
+ export declare const Form: (
28
+ attributes?: FormAttributes,
29
+ children?: ValidChild
30
+ ) => NdHTMLElement<HTMLFormElement> & {
31
+ submit: (actionOrFn: string | ((e: SubmitEvent) => void)) => NdHTMLElement<HTMLFormElement>;
32
+ post: (action: string) => NdHTMLElement<HTMLFormElement>;
33
+ get: (action: string) => NdHTMLElement<HTMLFormElement>;
34
+ multipartFormData: () => NdHTMLElement<HTMLFormElement>;
12
35
  };
13
36
 
14
- export declare const Input: ElementFunction;
15
- export declare const TextArea: ElementFunction;
16
- export declare const Select: ElementFunction;
17
- export declare const Option: ElementFunction;
18
- export declare const Button: ElementFunction;
19
-
20
- // Specialized Input Types
21
- export declare const HiddenInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
22
- export declare const FileInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
23
- export declare const PasswordInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
24
- export declare const Checkbox: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
25
- export declare const Radio: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
26
- export declare const NumberInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
27
- export declare const EmailInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
28
- export declare const DateInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
29
- export declare const TimeInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
30
- export declare const RangeInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
31
- export declare const ColorInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
32
-
33
- export declare const ReadonlyInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
34
- export declare const DateTimeInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
35
- export declare const WeekInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
36
- export declare const MonthInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
37
- export declare const SearchInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
38
- export declare const TelInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
39
- export declare const UrlInput: (attributes?: Attributes) => HTMLInputElement & { nd: NDElement };
40
-
41
- export declare const TextInput: ElementFunction;
42
- export declare const FieldSet: ElementFunction;
43
- export declare const Legend: ElementFunction;
44
- export declare const Datalist: ElementFunction;
45
- export declare const Output: ElementFunction;
46
- export declare const Progress: ElementFunction;
47
- export declare const Meter: ElementFunction;
48
-
49
- // Specialized Button Types
50
- export declare const SimpleButton: (child: ValidChild, attributes?: Attributes) => HTMLButtonElement & { nd: NDElement };
51
- export declare const SubmitButton: (child: ValidChild, attributes?: Attributes) => HTMLButtonElement & { nd: NDElement };
37
+ // ─────────────────────────────────────────────
38
+ // Input
39
+ // ─────────────────────────────────────────────
40
+
41
+ export declare const Input: ElementFunctionNoChildren<InputAttributes, HTMLInputElement>;
42
+ export declare const ReadonlyInput: (attributes?: Omit<InputAttributes, 'type' | 'readonly' | 'readOnly'>) => NdHTMLElement<HTMLInputElement>;
43
+ export declare const HiddenInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
44
+ export declare const FileInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
45
+ export declare const PasswordInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
46
+ export declare const Checkbox: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
47
+ export declare const Radio: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
48
+ export declare const RangeInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
49
+ export declare const ColorInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
50
+ export declare const DateInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
51
+ export declare const TimeInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
52
+ export declare const DateTimeInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
53
+ export declare const WeekInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
54
+ export declare const MonthInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
55
+ export declare const SearchInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
56
+ export declare const TelInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
57
+ export declare const UrlInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
58
+ export declare const EmailInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
59
+ export declare const NumberInput: (attributes?: Omit<InputAttributes, 'type'>) => NdHTMLElement<HTMLInputElement>;
60
+
61
+ // ─────────────────────────────────────────────
62
+ // Textarea & Select
63
+ // ─────────────────────────────────────────────
64
+
65
+ export declare const TextArea: ElementFunction<TextAreaAttributes, HTMLTextAreaElement>;
66
+ export declare const TextInput: typeof TextArea;
67
+ export declare const Select: ElementFunction<SelectAttributes, HTMLSelectElement>;
68
+ export declare const Option: ElementFunction<OptionAttributes, HTMLOptionElement>;
69
+
70
+ // ─────────────────────────────────────────────
71
+ // Button
72
+ // ─────────────────────────────────────────────
73
+
74
+ export declare const Button: ElementFunction<ButtonAttributes, HTMLButtonElement>;
75
+ export declare const SimpleButton: (children?: ValidChild, attributes?: Omit<ButtonAttributes, 'type'>) => NdHTMLElement<HTMLButtonElement>;
76
+ export declare const SubmitButton: (children?: ValidChild, attributes?: Omit<ButtonAttributes, 'type'>) => NdHTMLElement<HTMLButtonElement>;
77
+
78
+ // ─────────────────────────────────────────────
79
+ // Other form elements
80
+ // ─────────────────────────────────────────────
81
+
82
+ export declare const FieldSet: ElementFunction<GlobalAttributes & { disabled?: Observable<boolean> }, HTMLFieldSetElement>;
83
+ export declare const Legend: ElementFunction<GlobalAttributes, HTMLLegendElement>;
84
+ export declare const Label: ElementFunction<LabelAttributes, HTMLLabelElement>;
85
+ export declare const Datalist: ElementFunction<GlobalAttributes, HTMLDataListElement>;
86
+ export declare const Output: ElementFunction<OutputAttributes, HTMLOutputElement>;
87
+ export declare const Progress: ElementFunction<ProgressAttributes, HTMLProgressElement>;
88
+ export declare const Meter: ElementFunction<MeterAttributes, HTMLMeterElement>;
package/types/images.d.ts CHANGED
@@ -1,16 +1,23 @@
1
1
  // Image components type definitions
2
- import {Attributes, ElementFunction, NDElement} from './elements';
3
- import {ObservableItem} from "./observable";
2
+ import { ElementFunctionNoChildren, NdHTMLElement } from './elements';
3
+ import { ImgAttributes } from './elements';
4
+ import { ObservableItem } from "./observable";
4
5
 
6
+ export declare const BaseImage: ElementFunctionNoChildren<ImgAttributes, HTMLImageElement>;
5
7
 
6
- export declare const BaseImage: ElementFunction;
8
+ export declare const Img: (
9
+ src: string | ObservableItem<string>,
10
+ attributes?: Omit<ImgAttributes, 'src'>
11
+ ) => NdHTMLElement<HTMLImageElement>;
7
12
 
8
- // Image Elements
9
- export declare const Img: (src: string | ObservableItem<string>, attributes?: Attributes) => HTMLImageElement & { nd: NDElement };
10
13
  export declare const AsyncImg: (
11
14
  src: string | ObservableItem<string>,
12
- defaultImage?: string,
13
- attributes?: Attributes,
15
+ defaultImage?: string | null,
16
+ attributes?: Omit<ImgAttributes, 'src'>,
14
17
  callback?: (error: Error | null, img?: HTMLImageElement) => void
15
- ) => HTMLImageElement & { nd: NDElement };
16
- export declare const LazyImg: (src: string | ObservableItem<string>, attributes?: Attributes) => HTMLImageElement & { nd: NDElement };
18
+ ) => NdHTMLElement<HTMLImageElement>;
19
+
20
+ export declare const LazyImg: (
21
+ src: string | ObservableItem<string>,
22
+ attributes?: Omit<ImgAttributes, 'src' | 'loading'>
23
+ ) => NdHTMLElement<HTMLImageElement>;