Skip to content
Merged
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
10 changes: 5 additions & 5 deletions packages/core/src/models/uischema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export interface HorizontalLayout extends Layout {
* A group resembles a vertical layout, but additionally might have a label.
* This layout is useful when grouping different elements by a certain criteria.
*/
export interface GroupLayout extends Layout, Labelable {
export interface GroupLayout extends Layout, Labelable, Internationalizable {
type: 'Group';
}

Expand Down Expand Up @@ -247,7 +247,7 @@ export interface ControlElement extends UISchemaElement, Scoped, Labelable<strin
/**
* The category layout.
*/
export interface Category extends Layout, Labeled {
export interface Category extends Layout, Labeled, Internationalizable {
type: 'Category';
}

Expand All @@ -256,7 +256,7 @@ export interface Category extends Layout, Labeled {
* A child element may either be itself a Categorization or a Category, hence
* the categorization element can be used to represent recursive structures like trees.
*/
export interface Categorization extends UISchemaElement, Labeled {
export interface Categorization extends UISchemaElement, Labeled, Internationalizable {
type: 'Categorization';
/**
* The child elements of this categorization which are either of type
Expand All @@ -275,13 +275,13 @@ export const isLayout = (uischema: UISchemaElement): uischema is Layout =>
(uischema as Layout).elements !== undefined;

export const isScopable = (obj: unknown): obj is Scopable =>
obj && typeof obj === 'object';
!!obj && typeof obj === 'object';

export const isScoped = (obj: unknown): obj is Scoped =>
isScopable(obj) && typeof obj.scope === 'string';

export const isLabelable = (obj: unknown): obj is Labelable =>
obj && typeof obj === 'object';
!!obj && typeof obj === 'object';

export const isLabeled = <T = never>(obj: unknown): obj is Labeled<T> =>
isLabelable(obj) && ['string', 'boolean'].includes(typeof obj.label);