Skip to content

Commit cf1aab5

Browse files
committed
update comments, do not duplicate filtered methods in comments (may become out of sync with types)
1 parent a7c90d0 commit cf1aab5

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

types/index.d.ts

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,20 @@ export interface FilePondProps extends FilePondOptions {
4444
export class FilePond extends React.Component<FilePondProps> {}
4545

4646
/*
47-
According to react-filepond implementation, every FilePond instance key is cloned except these:
48-
(see <https://github.com/pqina/react-filepond/blob/7deaee287dd24614706f2401dcf39df6207ef5ef/lib/index.js#L13>
49-
and <https://github.com/pqina/react-filepond/blob/7deaee287dd24614706f2401dcf39df6207ef5ef/lib/index.js#L56-L61>)
47+
According to react-filepond implementation, every FilePond instance key is cloned except some from an array, see
48+
<https://github.com/pqina/react-filepond/blob/7deaee287dd24614706f2401dcf39df6207ef5ef/lib/index.js#L13> and
49+
<https://github.com/pqina/react-filepond/blob/7deaee287dd24614706f2401dcf39df6207ef5ef/lib/index.js#L56-L61>.
5050
51-
- setOptions
52-
- on
53-
- off
54-
- onOnce
55-
- appendTo
56-
- insertAfter
57-
- insertBefore
58-
- isAttachedTo
59-
- replaceElement
60-
- restoreElement
61-
- destroy
62-
63-
(as of 2020-08-27)
51+
Exluded keys as of 2020-08-27:
52+
*/
53+
type FilteredMethods = 'setOptions' | 'on' | 'off' | 'onOnce' | 'appendTo' |
54+
'insertAfter' | 'insertBefore' | 'isAttachedTo' |
55+
'replaceElement' | 'restoreElement' | 'destroy' | keyof FilePondOptions;
6456

57+
/*
6558
We mix cloned methods into FilePond class declared above by declaring FilePond a SECOND TIME
6659
as an interface (this is possible, see <https://www.typescriptlang.org/docs/handbook/declaration-files/deep-dive.html#adding-using-an-interface>
6760
"This also works with classes: [...]")
6861
*/
6962

70-
type FilteredMethods = 'setOptions' | 'on' | 'off' | 'onOnce' | 'appendTo' |
71-
'insertAfter' | 'insertBefore' | 'isAttachedTo' |
72-
'replaceElement' | 'restoreElement' | 'destroy' | keyof FilePondOptions;
73-
7463
export interface FilePond extends Omit<Upstream_FilePond, FilteredMethods> {}

0 commit comments

Comments
 (0)