Skip to content

Commit

Permalink
fix(types): update dependency dtslint to v2.0.3 and fix linter proble…
Browse files Browse the repository at this point in the history
…ms (#92)


* chore(deps): update dependency dtslint to v2.0.3
* fix type linter
Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Dmitry Ivakhnenko <[email protected]>
  • Loading branch information
renovate[bot] authored and jeetiss committed Jan 7, 2020
1 parent f55f992 commit 0d26981
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 33 deletions.
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@types/react": "16.9.17",
"assert": "2.0.0",
"babel-eslint": "10.0.3",
"dtslint": "2.0.2",
"dtslint": "2.0.3",
"eslint": "6.8.0",
"eslint-config-prettier": "6.9.0",
"eslint-config-standard": "14.1.0",
Expand Down
51 changes: 35 additions & 16 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentType, Ref, RefForwardingComponent } from 'react';
import JQuery = require('jquery');

export type Locale =
type Locale =
'en' |
'ar' |
'az' |
Expand Down Expand Up @@ -33,9 +33,9 @@ export type Locale =
'zhTW' |
'zh';

export type LocalePluralize = (n: number) => string;
type LocalePluralize = (n: number) => string;

export interface LocaleTranslations {
interface LocaleTranslations {
uploading?: string;
loadingInfo?: string;
errors?: {
Expand Down Expand Up @@ -192,12 +192,12 @@ export interface LocaleTranslations {
};
}

export interface GeoLocation {
interface GeoLocation {
latitude: number;
longitude: number;
}

export interface OriginalImageInfo {
interface OriginalImageInfo {
height: number;
width: number;
geo_location: null | GeoLocation;
Expand All @@ -209,14 +209,14 @@ export interface OriginalImageInfo {
sequence?: boolean;
}

export type Uuid = string;
type Uuid = string;

export interface SourceInfo {
interface SourceInfo {
source: string;
file: any;
}

export interface FileInfo {
interface FileInfo {
uuid: Uuid;
name: null | string;
size: null | number;
Expand All @@ -230,9 +230,9 @@ export interface FileInfo {
sourceInfo: null | SourceInfo;
}

export type OnTabVisibilityCallback = (tab: string, shown: boolean) => void;
type OnTabVisibilityCallback = (tab: string, shown: boolean) => void;

export interface DialogApi {
interface DialogApi {
addFiles(files: FileInfo[]): void;
switchTab(tab: string): void;
fileColl: FileInfo[];
Expand All @@ -242,7 +242,7 @@ export interface DialogApi {
onTabVisibility(callback: OnTabVisibilityCallback): void;
}

export interface Settings {
interface Settings {
// developer hooks
locale?: Locale;
localePluralize?: (n: number) => string;
Expand Down Expand Up @@ -293,13 +293,13 @@ export interface Settings {
effects?: string | string[];
}

export interface WidgetAPI {
interface WidgetAPI {
openDialog: (tab: string) => void;
reloadInfo: () => void;
getInput: () => HTMLInputElement;
}

export interface WidgetProps extends Settings {
interface WidgetProps extends Settings {
value?: string;
onChange?: (fileInfo: FileInfo) => void;
onFileSelect?: (fileInfo: FileInfo) => void;
Expand All @@ -309,7 +309,7 @@ export interface WidgetProps extends Settings {
ref?: Ref<WidgetAPI>;
}

export type CustomTabConstructor = (
type CustomTabConstructor = (
container: JQuery,
button: JQuery,
dialogApi: DialogApi,
Expand All @@ -318,11 +318,30 @@ export type CustomTabConstructor = (
uploadcare: any
) => void;

export type Validator = ((fileInfo: FileInfo) => void);
type Validator = ((fileInfo: FileInfo) => void);

export const Widget: RefForwardingComponent<{
declare const Widget: RefForwardingComponent<{
locale?: Locale;
localeTranslations?: LocaleTranslations;
localePluralize?: LocalePluralize;
preloader?: string;
}, WidgetProps>;

export {
Locale,
LocalePluralize,
LocaleTranslations,
GeoLocation,
OriginalImageInfo,
Uuid,
SourceInfo,
FileInfo,
DialogApi,
OnTabVisibilityCallback,
Settings,
WidgetAPI,
WidgetProps,
CustomTabConstructor,
Validator,
Widget
};

0 comments on commit 0d26981

Please sign in to comment.