-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoordinator.ts
More file actions
74 lines (68 loc) · 1.44 KB
/
coordinator.ts
File metadata and controls
74 lines (68 loc) · 1.44 KB
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
74
import type { Border, Theme } from "./theme.ts";
/**
* Represents the width and height dimensions.
*/
export type Size = {
width: number;
height: number;
};
/**
* Dimension: size with position (col, row).
*/
export type Dimension = Size & {
col: number;
row: number;
};
/**
* Styles for the picker components.
*/
export type Style = {
/**
* The border style for the input component.
*/
input: Border;
/**
* The border style for the list component.
*/
list: Border;
/**
* The border style for the preview component, if applicable.
*/
preview?: Border;
};
/**
* Layout for the picker components.
*/
export type Layout = {
/**
* Dimensions of the input component.
*/
input: Dimension;
/**
* Dimensions of the list component.
*/
list: Dimension;
/**
* Dimensions of the preview component, if applicable.
*/
preview?: Dimension;
};
/**
* Coordinator for managing the layout and style of picker components.
*/
export type Coordinator = {
/**
* Retrieves the style for the picker components.
*
* @param theme - The theme used to style the components.
* @returns The style configuration for the picker components.
*/
style(theme: Theme): Style;
/**
* Determines the layout for the picker components based on screen size.
*
* @param screen - The size of the screen.
* @returns The layout configuration for the picker components.
*/
layout(screen: Size): Layout;
};