|
1 | 1 | /// <reference types="react" /> |
2 | 2 |
|
3 | | -type ConfigPlainType = import('../dist/index.ts').ConfigPlainType; |
| 3 | +type LitBlock = import('../dist/index.ts').Block; |
4 | 4 | type UploadCtxProvider = import('../dist/index.ts').UploadCtxProvider; |
5 | 5 | type Config = import('../dist/index.ts').Config; |
6 | 6 | type FileUploaderInline = import('../dist/index.ts').FileUploaderInline; |
7 | 7 | type FileUploaderRegular = import('../dist/index.ts').FileUploaderRegular; |
8 | 8 | type FileUploaderMinimal = import('../dist/index.ts').FileUploaderMinimal; |
| 9 | +type BtnUi = import('../dist/index.ts').BtnUi; |
| 10 | +type LineLoaderUi = import('../dist/index.ts').LineLoaderUi; |
| 11 | +type PresenceToggle = import('../dist/index.ts').PresenceToggle; |
| 12 | +type SliderUi = import('../dist/index.ts').SliderUi; |
| 13 | +type CropFrame = import('../dist/index.ts').CropFrame; |
| 14 | +type EditorCropButtonControl = import('../dist/index.ts').EditorCropButtonControl; |
| 15 | +type EditorAspectRatioButtonControl = import('../dist/index.ts').EditorAspectRatioButtonControl; |
| 16 | +type EditorFreeformButtonControl = import('../dist/index.ts').EditorFreeformButtonControl; |
| 17 | +type EditorFilterControl = import('../dist/index.ts').EditorFilterControl; |
| 18 | +type EditorOperationControl = import('../dist/index.ts').EditorOperationControl; |
| 19 | +type EditorImageCropper = import('../dist/index.ts').EditorImageCropper; |
| 20 | +type EditorImageFader = import('../dist/index.ts').EditorImageFader; |
| 21 | +type EditorScroller = import('../dist/index.ts').EditorScroller; |
| 22 | +type EditorSlider = import('../dist/index.ts').EditorSlider; |
| 23 | +type EditorToolbar = import('../dist/index.ts').EditorToolbar; |
| 24 | +type Icon = import('../dist/index.ts').Icon; |
| 25 | +type Img = import('../dist/index.ts').Img; |
| 26 | +type SimpleBtn = import('../dist/index.ts').SimpleBtn; |
| 27 | +type StartFrom = import('../dist/index.ts').StartFrom; |
| 28 | +type DropArea = import('../dist/index.ts').DropArea; |
| 29 | +type SourceBtn = import('../dist/index.ts').SourceBtn; |
| 30 | +type SourceList = import('../dist/index.ts').SourceList; |
| 31 | +type FileItem = import('../dist/index.ts').FileItem; |
| 32 | +type Modal = import('../dist/index.ts').Modal; |
| 33 | +type UploadList = import('../dist/index.ts').UploadList; |
| 34 | +type UrlSource = import('../dist/index.ts').UrlSource; |
| 35 | +type CameraSource = import('../dist/index.ts').CameraSource; |
| 36 | +type ProgressBarCommon = import('../dist/index.ts').ProgressBarCommon; |
| 37 | +type ProgressBar = import('../dist/index.ts').ProgressBar; |
| 38 | +type ExternalSource = import('../dist/index.ts').ExternalSource; |
| 39 | +type CloudImageEditorActivity = import('../dist/index.ts').CloudImageEditorActivity; |
9 | 40 | type FormInput = import('../dist/index.ts').FormInput; |
10 | 41 | type CloudImageEditorBlock = import('../dist/index.ts').CloudImageEditorBlock; |
11 | | -type CtxAttributes = { |
12 | | - 'ctx-name': string; |
13 | | - testMode?: boolean; |
14 | | -}; |
| 42 | + |
15 | 43 | type CommonHtmlAttributes<T> = Partial< |
16 | 44 | Pick<React.HTMLAttributes<T>, 'id' | 'children' | 'hidden'> & { class: React.HTMLAttributes<T>['className'] } |
17 | 45 | >; |
18 | 46 |
|
19 | | -type CustomElement<C, A = {}> = React.DetailedHTMLProps<CommonHtmlAttributes<C>, C> & A; |
| 47 | +type ReflectAttributes<T extends LitBlock> = T['attributesMeta']; |
| 48 | + |
| 49 | +type CustomElement<C> = React.DetailedHTMLProps<CommonHtmlAttributes<C>, C> & ReflectAttributes<C>; |
20 | 50 |
|
21 | 51 | declare namespace JSX { |
22 | 52 | interface IntrinsicElements { |
23 | | - 'uc-crop-frame': any; |
24 | | - 'uc-editor-crop-button-control': any; |
25 | | - 'uc-editor-aspect-ratio-button-control': any; |
26 | | - 'uc-editor-freeform-button-control': any; |
27 | | - 'uc-editor-filter-control': any; |
28 | | - 'uc-editor-operation-control': any; |
29 | | - 'uc-editor-image-cropper': any; |
30 | | - 'uc-editor-image-fader': any; |
31 | | - 'uc-editor-scroller': any; |
32 | | - 'uc-editor-slider': any; |
33 | | - 'uc-editor-toolbar': any; |
34 | | - 'uc-btn-ui': any; |
35 | | - 'uc-line-loader-ui': any; |
36 | | - 'uc-presence-toggle': any; |
37 | | - 'uc-slider-ui': any; |
38 | | - 'uc-icon': any; |
39 | | - 'uc-img': any; |
40 | | - 'uc-simple-btn': any; |
41 | | - 'uc-start-from': any; |
42 | | - 'uc-drop-area': any; |
43 | | - 'uc-source-btn': any; |
44 | | - 'uc-source-list': any; |
45 | | - 'uc-file-item': any; |
46 | | - 'uc-modal': any; |
47 | | - 'uc-upload-list': any; |
48 | | - 'uc-url-source': any; |
49 | | - 'uc-camera-source': any; |
50 | | - 'uc-progress-bar-common': any; |
51 | | - 'uc-progress-bar': any; |
52 | | - 'uc-external-source': any; |
53 | | - 'uc-cloud-image-editor-activity': any; |
54 | | - 'uc-cloud-image-editor-block': CustomElement< |
55 | | - CloudImageEditorBlock, |
56 | | - CtxAttributes & ({ uuid: string } | { 'cdn-url': string }) & Partial<{ tabs: string; 'crop-preset': string }> |
57 | | - >; |
58 | | - 'uc-cloud-image-editor': CustomElement<CloudImageEditorBlock, JSX.IntrinsicElements['uc-cloud-image-editor-block']>; |
59 | | - 'uc-form-input': CustomElement<FormInput, CtxAttributes>; |
60 | | - 'uc-file-uploader-regular': CustomElement<FileUploaderRegular, CtxAttributes & Partial<{ headless: boolean }>>; |
61 | | - 'uc-file-uploader-minimal': CustomElement<FileUploaderMinimal, CtxAttributes>; |
62 | | - 'uc-file-uploader-inline': CustomElement<FileUploaderInline, CtxAttributes>; |
63 | | - 'uc-upload-ctx-provider': CustomElement<UploadCtxProvider, CtxAttributes>; |
64 | | - 'uc-config': CustomElement<Config, CtxAttributes & Partial<ConfigPlainType>>; |
| 53 | + 'uc-crop-frame': CustomElement<CropFrame>; |
| 54 | + 'uc-editor-crop-button-control': CustomElement<EditorCropButtonControl>; |
| 55 | + 'uc-editor-aspect-ratio-button-control': CustomElement<EditorAspectRatioButtonControl>; |
| 56 | + 'uc-editor-freeform-button-control': CustomElement<EditorFreeformButtonControl>; |
| 57 | + 'uc-editor-filter-control': CustomElement<EditorFilterControl>; |
| 58 | + 'uc-editor-operation-control': CustomElement<EditorOperationControl>; |
| 59 | + 'uc-editor-image-cropper': CustomElement<EditorImageCropper>; |
| 60 | + 'uc-editor-image-fader': CustomElement<EditorImageFader>; |
| 61 | + 'uc-editor-scroller': CustomElement<EditorScroller>; |
| 62 | + 'uc-editor-slider': CustomElement<EditorSlider>; |
| 63 | + 'uc-editor-toolbar': CustomElement<EditorToolbar>; |
| 64 | + 'uc-btn-ui': CustomElement<BtnUi>; |
| 65 | + 'uc-line-loader-ui': CustomElement<LineLoaderUi>; |
| 66 | + 'uc-presence-toggle': CustomElement<PresenceToggle>; |
| 67 | + 'uc-slider-ui': CustomElement<SliderUi>; |
| 68 | + 'uc-icon': CustomElement<Icon>; |
| 69 | + 'uc-img': CustomElement<Img>; |
| 70 | + 'uc-simple-btn': CustomElement<SimpleBtn>; |
| 71 | + 'uc-start-from': CustomElement<StartFrom>; |
| 72 | + 'uc-drop-area': CustomElement<DropArea>; |
| 73 | + 'uc-source-btn': CustomElement<SourceBtn>; |
| 74 | + 'uc-source-list': CustomElement<SourceList>; |
| 75 | + 'uc-file-item': CustomElement<FileItem>; |
| 76 | + 'uc-modal': CustomElement<Modal>; |
| 77 | + 'uc-upload-list': CustomElement<UploadList>; |
| 78 | + 'uc-url-source': CustomElement<UrlSource>; |
| 79 | + 'uc-camera-source': CustomElement<CameraSource>; |
| 80 | + 'uc-progress-bar-common': CustomElement<ProgressBarCommon>; |
| 81 | + 'uc-progress-bar': CustomElement<ProgressBar>; |
| 82 | + 'uc-external-source': CustomElement<ExternalSource>; |
| 83 | + 'uc-cloud-image-editor-activity': CustomElement<CloudImageEditorActivity>; |
| 84 | + 'uc-cloud-image-editor-block': CustomElement<CloudImageEditorBlock>; |
| 85 | + 'uc-cloud-image-editor': CustomElement<CloudImageEditorBlock>; |
| 86 | + 'uc-form-input': CustomElement<FormInput>; |
| 87 | + 'uc-file-uploader-regular': CustomElement<FileUploaderRegular>; |
| 88 | + 'uc-file-uploader-minimal': CustomElement<FileUploaderMinimal>; |
| 89 | + 'uc-file-uploader-inline': CustomElement<FileUploaderInline>; |
| 90 | + 'uc-upload-ctx-provider': CustomElement<UploadCtxProvider>; |
| 91 | + 'uc-config': CustomElement<Config>; |
65 | 92 | } |
66 | 93 | } |
0 commit comments