Skip to content

Commit be33e9f

Browse files
committed
Support recursive definitions and complex template literals
Support full template expansion Fix naming collision for InputProps Fix missing props for Checkbox
1 parent f7cc208 commit be33e9f

File tree

2 files changed

+229
-68
lines changed

2 files changed

+229
-68
lines changed

Diff for: packages/ui-extensions/src/surfaces/admin/components.d.ts

+29-29
Original file line numberDiff line numberDiff line change
@@ -2794,11 +2794,9 @@ export type ButtonBaseProps = Required<
27942794
| 'target'
27952795
| 'href'
27962796
| 'download'
2797-
| 'onBlur'
2798-
| 'onClick'
2799-
| 'onFocus'
28002797
>
2801-
>;
2798+
> &
2799+
Pick<ButtonOnlyProps, 'onBlur' | 'onClick' | 'onFocus'>;
28022800
export interface ButtonProps extends ButtonBaseProps {
28032801
tone: Extract<ButtonProps$1['tone'], 'neutral' | 'critical' | 'auto'>;
28042802
icon: IconProps['type'];
@@ -2856,24 +2854,24 @@ declare module 'preact' {
28562854
}
28572855

28582856
declare const internals: unique symbol;
2859-
export type InputProps = Required<
2857+
export type InputElementInputProps = Required<
28602858
Pick<TextFieldProps, 'disabled' | 'id' | 'name' | 'value'>
28612859
>;
28622860
declare class PreactInputElement
28632861
extends PreactCustomElement
2864-
implements InputProps
2862+
implements InputElementInputProps
28652863
{
28662864
static formAssociated: boolean;
28672865
/** @private */
28682866
[internals]: ElementInternals;
28692867
protected getDefaultValue(): string;
28702868
accessor onchange: EventListener | null;
28712869
accessor oninput: EventListener | null;
2872-
accessor disabled: InputProps['disabled'];
2873-
accessor id: InputProps['id'];
2874-
accessor name: InputProps['name'];
2875-
get value(): InputProps['value'];
2876-
set value(value: InputProps['value']);
2870+
accessor disabled: InputElementInputProps['disabled'];
2871+
accessor id: InputElementInputProps['id'];
2872+
accessor name: InputElementInputProps['name'];
2873+
get value(): InputElementInputProps['value'];
2874+
set value(value: InputElementInputProps['value']);
28772875
constructor(renderImpl: RenderImpl);
28782876
}
28792877

@@ -2889,7 +2887,8 @@ export type CheckboxProps = InputProps &
28892887
| 'label'
28902888
| 'required'
28912889
>
2892-
>;
2890+
> &
2891+
Pick<CheckboxProps$1, 'onChange' | 'onInput'>;
28932892

28942893
declare const tagName$i = 'shopify-checkbox';
28952894
export interface ReactProps$i
@@ -3207,28 +3206,29 @@ export type FieldReactProps = Pick<
32073206
declare const tagName$8 = 'shopify-select';
32083207
export interface ReactProps$8 extends Partial<SharedProps & FieldReactProps> {}
32093208

3210-
export type FieldProps<Autocomplete extends string = string> = InputProps &
3211-
Required<
3212-
Pick<
3213-
TextFieldProps,
3214-
| 'defaultValue'
3215-
| 'details'
3216-
| 'error'
3217-
| 'label'
3218-
| 'placeholder'
3219-
| 'readOnly'
3220-
| 'required'
3221-
>
3222-
> & {
3223-
autocomplete: Autocomplete;
3224-
};
3209+
export type FieldPropsAutocomplete<Autocomplete extends string = string> =
3210+
InputProps &
3211+
Required<
3212+
Pick<
3213+
TextFieldProps,
3214+
| 'defaultValue'
3215+
| 'details'
3216+
| 'error'
3217+
| 'label'
3218+
| 'placeholder'
3219+
| 'readOnly'
3220+
| 'required'
3221+
>
3222+
> & {
3223+
autocomplete: Autocomplete;
3224+
};
32253225
declare class PreactFieldElement<Autocomplete extends string = string>
32263226
extends PreactInputElement
3227-
implements FieldProps<Autocomplete>
3227+
implements FieldPropsAutocomplete<Autocomplete>
32283228
{
32293229
accessor onblur: EventListener | null;
32303230
accessor onfocus: EventListener | null;
3231-
accessor autocomplete: FieldProps<Autocomplete>['autocomplete'];
3231+
accessor autocomplete: FieldPropsAutocomplete<Autocomplete>['autocomplete'];
32323232
accessor defaultValue: FieldProps['defaultValue'];
32333233
accessor details: FieldProps['details'];
32343234
accessor error: FieldProps['error'];

0 commit comments

Comments
 (0)