Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generator for single dts #2566

Draft
wants to merge 2 commits into
base: internal
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build": "loom build",
"build-consumer": "loom build && ./scripts/build-consumer.sh",
"build-consumer-spin": "loom build && ./scripts/build-consumer-spin.sh",
"generate-definition": "node ./scripts/generator.js",
"generate-definitions": "node ./scripts/generator.js",
"generate-definitions:admin": "yarn generate-definitions packages/ui-extensions/src/surfaces/admin/components.d.ts ../web/areas/clients/admin-web/app/shared/domains/extensibility/ui-extensions/components ../web/areas/clients/admin-web/app/shared/domains/extensibility/ui-extensions/definitionTemplate.txt",
"clean": "git clean -xdf ./packages; rm -rf ./build",
"predeploy": "yarn build",
"deploy": "changeset publish",
Expand Down
59 changes: 31 additions & 28 deletions packages/ui-extensions/src/surfaces/admin/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface BackgroundProps {
/**
* Adjust the background of the element.
*
* @default: 'transparent'
* @default 'transparent'
*/
background?: BackgroundColorKeyword;
}
Expand Down Expand Up @@ -1779,7 +1779,7 @@ interface SectionProps$1 extends GlobalProps {
* to the edge of the Section. For example, a full-width image. In this case, rely on `Box` with a padding of 'base'
* to bring back the desired padding for the rest of the content.
*
* @default: "auto"
* @default "auto"
*/
padding?: 'auto' | 'none';
}
Expand Down Expand Up @@ -2795,7 +2795,8 @@ export type ButtonBaseProps = Required<
| 'href'
| 'download'
>
>;
> &
Pick<ButtonOnlyProps, 'onBlur' | 'onClick' | 'onFocus'>;
export interface ButtonProps extends ButtonBaseProps {
tone: Extract<ButtonProps$1['tone'], 'neutral' | 'critical' | 'auto'>;
icon: IconProps['type'];
Expand Down Expand Up @@ -2853,24 +2854,24 @@ declare module 'preact' {
}

declare const internals: unique symbol;
export type InputProps = Required<
export type InputElementInputProps = Required<
Pick<TextFieldProps, 'disabled' | 'id' | 'name' | 'value'>
>;
declare class PreactInputElement
extends PreactCustomElement
implements InputProps
implements InputElementInputProps
{
static formAssociated: boolean;
/** @private */
[internals]: ElementInternals;
protected getDefaultValue(): string;
accessor onchange: EventListener | null;
accessor oninput: EventListener | null;
accessor disabled: InputProps['disabled'];
accessor id: InputProps['id'];
accessor name: InputProps['name'];
get value(): InputProps['value'];
set value(value: InputProps['value']);
accessor disabled: InputElementInputProps['disabled'];
accessor id: InputElementInputProps['id'];
accessor name: InputElementInputProps['name'];
get value(): InputElementInputProps['value'];
set value(value: InputElementInputProps['value']);
constructor(renderImpl: RenderImpl);
}

Expand All @@ -2886,7 +2887,8 @@ export type CheckboxProps = InputProps &
| 'label'
| 'required'
>
>;
> &
Pick<CheckboxProps$1, 'onChange' | 'onInput'>;

declare const tagName$i = 'shopify-checkbox';
export interface ReactProps$i
Expand Down Expand Up @@ -3204,28 +3206,29 @@ export type FieldReactProps = Pick<
declare const tagName$8 = 'shopify-select';
export interface ReactProps$8 extends Partial<SharedProps & FieldReactProps> {}

export type FieldProps<Autocomplete extends string = string> = InputProps &
Required<
Pick<
TextFieldProps,
| 'defaultValue'
| 'details'
| 'error'
| 'label'
| 'placeholder'
| 'readOnly'
| 'required'
>
> & {
autocomplete: Autocomplete;
};
export type FieldPropsAutocomplete<Autocomplete extends string = string> =
InputProps &
Required<
Pick<
TextFieldProps,
| 'defaultValue'
| 'details'
| 'error'
| 'label'
| 'placeholder'
| 'readOnly'
| 'required'
>
> & {
autocomplete: Autocomplete;
};
declare class PreactFieldElement<Autocomplete extends string = string>
extends PreactInputElement
implements FieldProps<Autocomplete>
implements FieldPropsAutocomplete<Autocomplete>
{
accessor onblur: EventListener | null;
accessor onfocus: EventListener | null;
accessor autocomplete: FieldProps<Autocomplete>['autocomplete'];
accessor autocomplete: FieldPropsAutocomplete<Autocomplete>['autocomplete'];
accessor defaultValue: FieldProps['defaultValue'];
accessor details: FieldProps['details'];
accessor error: FieldProps['error'];
Expand Down
Loading
Loading