-
Notifications
You must be signed in to change notification settings - Fork 429
/
Copy pathfile.d.ts
80 lines (80 loc) · 2.18 KB
/
file.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
74
75
76
77
78
79
80
declare module '@salesforce/design-system-react/components/files/file' {
import React from 'react';
type Props = {
/**
* **Assistive text for accessibility**
* * download - description for the download button if present
* * image - description for the file image
* * link - description for the file link
* * loading - description for the loading spinner if present
* * moreActions - description for the more actions dropdown if present
*/
assistiveText?: Partial<{
download?: string;
image?: string;
link?: string;
loading?: string;
moreActions?: string;
}>;
/**
* CSS class names to be added to the container element. `array`, `object`, or `string` are accepted.
*/
className?: any[] | Record<string, any> | string;
/**
* Controls different cropping aspect ratios for the component
*/
crop?: '16-by-9' | '4-by-3' | '1-by-1';
/**
* HTML id for component.
*/
id?: string;
/**
* Action to be done on clicking download button; doesn't show download button if empty
*/
onClickDownload?: (v: any) => any;
/**
* Function that is called when image is clicked; can be used instead of href for more advanced event handling
*/
onClickImage?: (v: any) => any;
/**
* Dropdown for more actions button; doesn't show more actions button if empty
*/
moreActionsDropdown?: React.ReactNode;
/**
* Icon associated with the file. Accepts an Icon component
*/
icon?: React.ReactNode;
/**
* Icon to be shown in top left corner of File component. Accepts an Icon component
*/
externalIcon?: React.ReactNode;
/**
* Link to thumbnail image
*/
image?: string;
/**
* Controls whether file preview is loading
*/
isLoading?: boolean;
/**
* Href attribute for image
*/
href?: string;
/**
* Labels for the File Component
* * image - title for the file. Required.
*/
labels?: Partial<{
title: string /*.isRequired*/;
}>;
/**
* Controls whether the file's title should be visible
*/
hasNoVisibleTitle?: boolean;
};
/**
* File is a component that represents content uploaded as an attachment.
*/
function Component(props: Props): JSX.Element;
export default Component;
}