-
Notifications
You must be signed in to change notification settings - Fork 47
/
index.d.ts
73 lines (67 loc) · 2.26 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/// <reference types="react" />
declare module 'oy-vey' {
export const Table: React.DetailedHTMLFactory<Oy.OyTableElementAttributes, HTMLTableElement>;
export const TBody: React.DetailedHTMLFactory<
Oy.OyTBodyElementAttributes,
HTMLTableSectionElement
>;
export const TR: React.DetailedHTMLFactory<Oy.OyTRElementAttributes, HTMLTableRowElement>;
export const TD: React.DetailedHTMLFactory<Oy.OyTDElementAttributes, HTMLTableDataCellElement>;
export const Img: React.DetailedHTMLFactory<Oy.OyImgElementAttributes, HTMLImageElement>;
export const A: React.DetailedHTMLFactory<Oy.OyAElementAttributes, HTMLAnchorElement>;
export const renderTemplate: (
jsx: JSX.Element,
opts: Oy.RenderOptions,
template?: (renderOpts: Oy.CustomTemplateRenderOptions) => string
) => string;
const oy: {
Table: typeof Table;
TBody: typeof TBody;
TR: typeof TR;
TD: typeof TD;
Img: typeof Img;
A: typeof A;
renderTemplate: typeof renderTemplate;
};
export default oy;
}
declare namespace Oy {
interface OyElementAttributes {
width?: number | string;
height?: number | string;
align?: 'left' | 'center' | 'right' | 'justify' | 'char';
background?: string;
bgcolor?: string;
border?: number;
valign?: 'top' | 'middle' | 'bottom' | 'baseline';
}
interface OyTBodyElementAttributes
extends React.HTMLAttributes<HTMLTableSectionElement>,
OyElementAttributes {}
interface OyTableElementAttributes
extends React.TableHTMLAttributes<HTMLTableElement>,
OyElementAttributes {}
interface OyTRElementAttributes
extends React.HTMLAttributes<HTMLTableRowElement>,
OyElementAttributes {}
interface OyTDElementAttributes
extends React.TdHTMLAttributes<HTMLTableDataCellElement>,
OyElementAttributes {}
interface OyImgElementAttributes
extends React.ImgHTMLAttributes<HTMLImageElement>,
OyElementAttributes {}
interface OyAElementAttributes
extends React.AnchorHTMLAttributes<HTMLAnchorElement>,
OyElementAttributes {}
type RenderOptions = {
title: string;
previewText: string;
headCSS?: string;
bgColor?: string;
lang?: string;
dir?: 'ltr' | 'rtl';
};
type CustomTemplateRenderOptions = RenderOptions & {
bodyContent: string;
};
}