Skip to content

Commit

Permalink
fix(Tile): updates types for child components
Browse files Browse the repository at this point in the history
  • Loading branch information
arwehrman committed Aug 9, 2023
1 parent 731a6f0 commit c571b14
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
42 changes: 20 additions & 22 deletions packages/@lightningjs/ui-components/src/components/Tile/Tile.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,51 +43,44 @@ type TileStyle = SurfaceStyle & {
};
declare namespace Tile {
export interface TemplateSpec extends Surface.TemplateSpec {
Content: typeof lng.Component<lng.Component.TemplateSpecLoose>;
/**
* Object containing all properties supported in the [Artwork component](?path=/docs/components-artwork--artwork)
*/
artwork: lng.Element.PatchTemplate<Artwork.TemplateSpec>;
/**
* Object containing all properties supported in the [Badge component](?path=/docs/components-badge--text)
*/
badge?: Record<string, unknown>;
badge?: lng.Element.PatchTemplate<Badge.TemplateSpec>;

/**
* Object containing all properties supported in the [Checkbox component](?path=/docs/components-checkbox--checkbox)
*/
checkbox?: Record<string, unknown>;
checkbox?: lng.Element.PatchTemplate<Checkbox.TemplateSpec>;
/**
* If true, changes format of itemLayout to circle
*/
circle?: boolean;
/**
* Object containing all properties supported in the [Label component](?path=/docs/components-label--label)
*/
label?: Record<string, unknown>;
label?: lng.Element.PatchTemplate<Label.TemplateSpec>;
/**
* Controls where there metadata is displayed in relation to the Tile. Available values are 'standard' and 'inset'
*/
metadataLocation?: string;
/**
* Object containing all properties supported in the [MetadataTile component](?path=/docs/components-metadatatile--metadata-tile)<br /> Can use a different Metadata component by passing in a 'type' and then that component's properties
*/
metadata?: MetadataBaseStyle;
metadata?: lng.Element.PatchTemplate<MetadataBase.TemplateSpec>;
/**
* Metadata will be shown at all times if set to true, otherwise it will only show when the Tile has focusMetadata will be shown at all times if set to true, otherwise it will only show when the Tile has focus
*/
persistentMetadata?: boolean;
/**
* Object containing all properties supported in the [ProgressBar component](?path=/docs/components-progressbar--progress-bar)
*/
progressBar?: Record<string, unknown>;
}

export interface TypeConfig extends lng.Component.TypeConfig {
SignalMapType: SignalMap;
progressBar?: lng.Element.PatchTemplate<ProgressBar.TemplateSpec>;
}
export type SignalMap = {
// Signals
// _imageLoaded
// _updateBadge
// _updateLabel
// _metadataLoaded
};
}
declare class Tile<
TemplateSpec extends Tile.TemplateSpec = Tile.TemplateSpec,
Expand All @@ -101,31 +94,36 @@ declare class Tile<
/**
* Object containing all properties supported in the [Badge component](?path=/docs/components-badge--text)
*/
badge?: Record<string, unknown>;
badge?: lng.Element.PatchTemplate<Badge.TemplateSpec>;

/**
* Object containing all properties supported in the [Checkbox component](?path=/docs/components-checkbox--checkbox)
*/
checkbox?: Record<string, unknown>;
checkbox?: lng.Element.PatchTemplate<Checkbox.TemplateSpec>;
/**
* If true, changes format of itemLayout to circle
*/
circle?: boolean;
/**
* Object containing all properties supported in the [Label component](?path=/docs/components-label--label)
*/
label?: Record<string, unknown>;
label?: lng.Element.PatchTemplate<Label.TemplateSpec>;
/**
* Controls where there metadata is displayed in relation to the Tile. Available values are 'standard' and 'inset'
*/
metadataLocation?: string;
/**
* Object containing all properties supported in the [MetadataTile component](?path=/docs/components-metadatatile--metadata-tile)<br /> Can use a different Metadata component by passing in a 'type' and then that component's properties
*/
metadata?: MetadataBaseStyle;
metadata?: lng.Element.PatchTemplate<MetadataBase.TemplateSpec>;
/**
* Metadata will be shown at all times if set to true, otherwise it will only show when the Tile has focusMetadata will be shown at all times if set to true, otherwise it will only show when the Tile has focus
*/
persistentMetadata?: boolean;
/**
* Object containing all properties supported in the [ProgressBar component](?path=/docs/components-progressbar--progress-bar)
*/
progressBar?: Record<string, unknown>;
progressBar?: lng.Element.PatchTemplate<ProgressBar.TemplateSpec>;

get innerH(): number;
get style(): TileStyle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ export default class Tile extends Surface {
static get properties() {
return [
'artwork',
'circle',
'badge',
'checkbox',
'circle',
'label',
'metadata',
'metadataLocation',
'persistentMetadata',
'progressBar',
'label',
'src'
];
}
Expand Down

0 comments on commit c571b14

Please sign in to comment.