docx
Version:
Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
37 lines (36 loc) • 1.55 kB
TypeScript
import { ParagraphChild } from '../../paragraph';
import { XmlComponent } from '../../xml-components';
import { LengthUnit } from '../types';
export type VmlShapeStyle = {
readonly flip?: "x" | "y" | "xy" | "yx";
readonly height?: LengthUnit;
readonly left?: LengthUnit;
readonly marginBottom?: LengthUnit;
readonly marginLeft?: LengthUnit;
readonly marginRight?: LengthUnit;
readonly marginTop?: LengthUnit;
readonly positionHorizontal?: "absolute" | "left" | "center" | "right" | "inside" | "outside";
readonly positionHorizontalRelative?: "margin" | "page" | "text" | "char";
readonly positionVertical?: "absolute" | "left" | "center" | "right" | "inside" | "outside";
readonly positionVerticalRelative?: "margin" | "page" | "text" | "char";
readonly wrapDistanceBottom?: number;
readonly wrapDistanceLeft?: number;
readonly wrapDistanceRight?: number;
readonly wrapDistanceTop?: number;
readonly wrapEdited?: boolean;
readonly wrapStyle?: "square" | "none";
readonly position?: "static" | "absolute" | "relative";
readonly rotation?: number;
readonly top?: LengthUnit;
readonly visibility?: "hidden" | "inherit";
readonly width: LengthUnit;
readonly zIndex?: "auto" | number;
};
type ShapeOptions = {
readonly id: string;
readonly children?: readonly ParagraphChild[];
readonly type?: string;
readonly style?: VmlShapeStyle;
};
export declare const createShape: ({ id, children, type, style }: ShapeOptions) => XmlComponent;
export {};