react-receipt-slip
Version:
The react-receipt-slip easiest way to create a receipt template.
217 lines (206 loc) • 6.3 kB
TypeScript
import * as styled_components_dist_types from 'styled-components/dist/types';
import * as react from 'react';
interface PaperProps extends react.PropsWithChildren {
/**
* Typical size in mm
* @default
* 80
*/
size?: number;
}
interface TextProps {
/**
* @default
* 'left'
*/
align?: 'left' | 'center' | 'right';
/**
* @default
* false
*/
bold?: boolean;
/**
* @default
* false
*/
underlined?: boolean;
/**
* ### New v1.1.1
*
* @default
* false
*/
italic?: boolean
}
interface LineProps {
/**
* ### New v1.1.1
* **Coordinates** [x, y]
*
* @property
* margin
*
* @example
* <Line margin={[5, 5]} />
*/
margin?: [number, number];
}
declare namespace Property {
type BorderStyle = 'none' | 'hidden' | 'dotted' | 'dashed' | 'solid' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset';
}
interface DotProps {
/**
* @deprecated
* removed
*/
type?: Property.BorderStyle;
/**
* @deprecated
* use margin instead
*/
vmar?: [number, number];
/**
* ### New v1.1.0
* **Coordinates** [x, y]
*
* @property
* margin
*
* @example
* <Dot margin={[0, 0]} />
*/
margin?: [number, number];
}
interface RowTextProps {
/**
* @deprecated
* use pad instead
*/
pady?: number;
/**
* @deprecated
* use pad instead
*/
padx?: number;
/**
* @deprecated
* use space instead
*/
gap?: number;
/**
* ### New v1.1.0
* **Coordinates** [x, y]
*
* @example
* <RowText padding={[5, 5]}>
* <Text>Name</Text>
* <Text>Age</Text>
* </RowText>
*/
padding?: [number, number];
/**
* ### Version v1.0.9
*
* Vertical alignment
*
* @property
* valign
*
* @example
* <RowText valign="center">
* <Text>Name</Text>
* <Text>Age</Text>
* </RowText>
*/
valign?: 'top' | 'bottom' | 'center';
/**
* ### New v1.1.0
*
* @property
* rowGrap
*
* @example
* <RowText space={10}>
* <Text>Name</Text>
* <Text>Age</Text>
* </RowText>
*/
space?: number
/**
* ### New v1.1.0
*
* @property
* justify
*
* @example
* <RowText justify="center">
* <Text>Name</Text>
* <Text>Age</Text>
* </RowText>
*/
justify?: "start" | "center" | "between" | "end"
}
interface DataTableProps {
/**
* ### Version v1.0.9
*
* @property
* bordered
*
* @example
* <DataTable bordered>
* ...
* </DataTable>
*/
bordered?: boolean;
/**
* ### New v1.1.0
*
* @property
* margin
*
* @example
* <DataTable collapse={false}>
* ...
* </DataTable>
*/
collapse?: boolean
}
interface TableRowProps {
align?: 'left' | 'center' | 'right';
}
interface TableHeadProps { }
interface TableCellProps {
/**
* Sets the horizontal alignment of text within the cell.
*
* - `'left'`: Aligns text to the left (default for most table cells).
* - `'center'`: Centers the text horizontally.
* - `'right'`: Aligns text to the right, often used for numbers.
*
* @example
* <TableCell align="center">Name</TableCell>
*/
align?: 'left' | 'center' | 'right';
}
interface SpaceProps {
/**
* **Coordinates** [x, y]
* @default [5, 5]
*
* @example
* [10, 10]
*/
size?: [number, number]
}
declare const Paper: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, PaperProps>> & string;
declare const Text: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, TextProps>> & string;
declare const Line: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, LineProps>> & string;
declare const Dot: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLHRElement>, HTMLHRElement>, DotProps>> & string;
declare const RowText: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, RowTextProps>> & string;
declare const DataTable: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, DataTableProps>> & string;
declare const TableRow: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, TableRowProps>> & string;
declare const TableHead: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, TableHeadProps>> & string;
declare const TableCell: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, TableCellProps & TextProps>> & string;
declare const Space: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SpaceProps>> & string;
export { DataTable, Dot, Line, Paper, RowText, Space, TableCell, TableHead, TableRow, Text };