Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Commit

Permalink
fix(types): fix some types
Browse files Browse the repository at this point in the history
* added missing typescript definitions for container, row and col

* added typescript definition file for dividers

* corrections in typescript definition of TextField

* corrections in typescript definition of Col

* typescript definition for SnackBar added

* wrong commits corrected
  • Loading branch information
huth-pesser committed Nov 26, 2020
1 parent 328f231 commit 3be086f
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 23 deletions.
40 changes: 20 additions & 20 deletions packages/svelte-materialify/@types/Col.d.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { SvelteComponent } from 'svelte-materialify/@types/shared';

interface ColProps {
/** cols adds class cols-true */
cols?: boolean;
/** sm adds class sm-true */
sm?: boolean;
/** md adds class md-true */
md?: boolean;
/** lg adds class lg-true */
lg?: boolean;
/** xl adds class xl-true */
xl?: boolean;
/** offset adds class offset-true */
offset?: boolean;
/** offset_sm adds class offset_sm-true */
offset_sm?: boolean;
/** offset_md adds class offset_md-true */
offset_md?: boolean;
/** offset_lg adds class offset_lg-true */
offset_lg?: boolean;
/** offset_xl adds class offset_xl-true */
offset_xl?: boolean;
/** cols adds class cols-<number> */
cols?: number;
/** sm adds class sm-<number> */
sm?: number;
/** md adds class md-<number> */
md?: number;
/** lg adds class lg-<number> */
lg?: number;
/** xl adds class xl-<number> */
xl?: number;
/** offset adds class offset-<number> */
offset?: number;
/** offset_sm adds class offset-sm-<number> */
offset_sm?: number;
/** offset_md adds class offset-md-<number> */
offset_md?: number;
/** offset_lg adds class offset-lg-<number> */
offset_lg?: number;
/** offset_xl adds class offset-xl-<number> */
offset_xl?: number;
/** classes added to the col */
class?: string;
/** styles added to the col */
Expand Down
43 changes: 43 additions & 0 deletions packages/svelte-materialify/@types/Snackbar.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { SvelteComponent } from 'svelte-materialify/@types/shared';
import { TransitionConfig } from 'svelte/transition';

interface SnackbarProps {
/** absolute sets the snackbar with position absolute otherwise it is fixed */
absolute?: boolean,
/** active shows or hides the snackbar */
active?: boolean,
/** top shows the snackbar on the top side of the page */
top?: boolean,
/** top shows the snackbar on the left side of the page */
left?: boolean,
/** top shows the snackbar on the bottom side of the page */
bottom?: boolean,
/** top shows the snackbar on the right side of the page */
right?: boolean,
/** top shows the snackbar on the centered of the page */
center?: boolean,
/** offsetY defines the offset from the left or right side of the page */
offsetX?: string,
/** offsetY defines the offset from the top or bottom side of the page */
offsetY?: string,
/** outlined gives the snackbar a outlined style */
outlined?: boolean,
/** text gives the snackbar a text style */
text?: boolean,
/** rounded gives the snackbar a rounded style */
rounded?: boolean,
/** tile gives the snackbar a tile style */
tile?: boolean,
/** timout is the delay before the snackar hides away */
timeout?: number,
/** transiton function for the snackbar */
transition?: (node: Element, options: any) => TransitionConfig;
/** classes added to the snackbar */
class?: string;
/** styles added to the snackbar */
style?: string;
}

declare class Snackbar extends SvelteComponent<SnackbarProps> {}

export default Snackbar;
6 changes: 3 additions & 3 deletions packages/svelte-materialify/@types/TextField.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ interface TextFieldProps {
// Creates counter for input length.
counter?: number;
// An array of functions which take input value as arguement and return error message.
rules: ((value) => string | false)[];
rules?: ((value) => string | true)[];
// Delays validation till blur.
validateOnBlur: boolean;
validateOnBlur?: boolean;
// Error state of the input.
error: boolean;
error?: boolean;
// Id of the text input.
id?: string;
}
Expand Down
1 change: 1 addition & 0 deletions packages/svelte-materialify/@types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export { default as NavigationDrawer } from './NavigationDrawer';
export { default as Dialog } from './Dialog';
export { default as Overlay } from './Overlay';
export { default as Row } from './Row';
export { default as Snackbar } from './Snackbar';
export { default as TextField } from './TextField';
export { default as ProgressLinear } from './ProgressLinear';
export { default as ProgressCircular } from './ProgressCircular';

1 comment on commit 3be086f

@vercel
Copy link

@vercel vercel bot commented on 3be086f Nov 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Please sign in to comment.