meo-canvas - v8.1.3
    Preparing search index...

    Type Alias CanvasElement

    CanvasElement:
        | {
            __type: "Box";
            children?: CanvasElement[];
            props: Omit<BoxProps, "children">;
        }
        | {
            __type: "Column";
            children?: CanvasElement[];
            props: Omit<BoxProps, "children">;
        }
        | {
            __type: "Row";
            children?: CanvasElement[];
            props: Omit<BoxProps, "children">;
        }
        | {
            __type: "Grid";
            children?: CanvasElement[];
            props: Omit<GridProps, "children">;
        }
        | {
            __type: "GridItem";
            children?: CanvasElement[];
            props: Omit<GridItemProps, "children">;
        }
        | { __type: "Image"; props: Omit<ImageProps, "onLoad" | "onError"> }
        | { __type: "Path"; props: PathProps }
        | { __type: "Text"; props?: TextProps; text: string | number }
        | {
            __type: "Chart";
            props: Omit<ChartProps<ChartType>, "options"> & {
                options?: Record<string, unknown>;
            };
        }

    A component described as plain data, tagged by __type.

    Factories return these rather than live nodes, which is what lets a whole tree cross into a worker thread by structured clone.

    Type Declaration

    • { __type: "Box"; children?: CanvasElement[]; props: Omit<BoxProps, "children"> }
      • __type: "Box"

        A plain container.

      • Optionalchildren?: CanvasElement[]

        Nested descriptors, drawn inside this one.

      • props: Omit<BoxProps, "children">

        Everything but the children, which are their own field.

    • {
          __type: "Column";
          children?: CanvasElement[];
          props: Omit<BoxProps, "children">;
      }
      • __type: "Column"

        A container that stacks its children vertically.

      • Optionalchildren?: CanvasElement[]

        Nested descriptors, drawn inside this one.

      • props: Omit<BoxProps, "children">

        Everything but the children, which are their own field.

    • { __type: "Row"; children?: CanvasElement[]; props: Omit<BoxProps, "children"> }
      • __type: "Row"

        A container that lays its children out in a line.

      • Optionalchildren?: CanvasElement[]

        Nested descriptors, drawn inside this one.

      • props: Omit<BoxProps, "children">

        Everything but the children, which are their own field.

    • {
          __type: "Grid";
          children?: CanvasElement[];
          props: Omit<GridProps, "children">;
      }
      • __type: "Grid"

        A container that places its children on a grid.

      • Optionalchildren?: CanvasElement[]

        Nested descriptors, drawn inside this one.

      • props: Omit<GridProps, "children">

        Everything but the children, which are their own field.

    • {
          __type: "GridItem";
          children?: CanvasElement[];
          props: Omit<GridItemProps, "children">;
      }
      • __type: "GridItem"

        One cell of a grid, which may span several tracks.

      • Optionalchildren?: CanvasElement[]

        Nested descriptors, drawn inside this one.

      • props: Omit<GridItemProps, "children">

        Everything but the children, which are their own field.

    • { __type: "Image"; props: Omit<ImageProps, "onLoad" | "onError"> }
      • __type: "Image"

        A raster image, fitted into its box by objectFit.

      • props: Omit<ImageProps, "onLoad" | "onError">

        The load callbacks are dropped: a function cannot cross into a worker.

    • { __type: "Path"; props: PathProps }
      • __type: "Path"

        An arbitrary shape from SVG path data.

      • props: PathProps

        The path and how it is painted.

    • { __type: "Text"; props?: TextProps; text: string | number }
      • __type: "Text"

        A run of text, which may carry inline markup.

      • Optionalprops?: TextProps

        Styling for the run.

      • text: string | number

        The string to draw. Numbers are accepted so a count needs no conversion.

    • {
          __type: "Chart";
          props: Omit<ChartProps<ChartType>, "options"> & {
              options?: Record<string, unknown>;
          };
      }
      • __type: "Chart"

        A chart, drawn from data rather than from child nodes.

      • props: Omit<ChartProps<ChartType>, "options"> & { options?: Record<string, unknown> }

        The chart minus its options, which are widened so they survive the worker boundary.