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

Commit

Permalink
feat(typing): adds more typescript definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
sbelzile-nexapp committed Sep 23, 2020
1 parent 8a2bba9 commit e2c6e67
Show file tree
Hide file tree
Showing 14 changed files with 271 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/svelte-materialify/@types/components/AppBar.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { SvelteComponent } from 'svelte';

declare class AppBar extends SvelteComponent {
$$prop_def: {
class?: string;
height?: string;
tile?: boolean;
flat?: boolean;
dense?: boolean;
prominent?: boolean;
fixed?: boolean;
absolute?: boolean;
collapsed?: boolean;
style?: string;
} & Record<string, any>;
}

export default AppBar;
24 changes: 24 additions & 0 deletions packages/svelte-materialify/@types/components/Button.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { SvelteComponent } from 'svelte';

declare class Button extends SvelteComponent {
$$prop_def: {
class?: string;
fab?: boolean;
icon?: boolean;
block?: boolean;
size?: 'x-small' | 'small' | 'default' | 'large' | 'x-large';
tile?: boolean;
text?: boolean;
depressed?: boolean;
outlined?: boolean;
rounded?: boolean;
disabled?: boolean;
active?: boolean;
activeClass?: string;
type?: 'button' | 'reset' | 'submit';
ripple?: any;
style?: string;
} & Record<string, any>;
}

export default Button;
16 changes: 16 additions & 0 deletions packages/svelte-materialify/@types/components/Icon.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { SvelteComponent } from 'svelte';

declare class Icon extends SvelteComponent {
$$prop_def: {
class?: string;
size?: string;
rotate?: number;
spin?: boolean;
disabled?: boolean;
path?: any;
label?: any;
style?: string;
} & Record<string, any>;
}

export default Icon;
19 changes: 19 additions & 0 deletions packages/svelte-materialify/@types/components/Input.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { SvelteComponent } from 'svelte';

declare class Input extends SvelteComponent {
$$prop_def: {
class?: string;
value?: any;
color?: string;
dense?: boolean;
readonly?: boolean;
disabled?: boolean;
counter?: boolean;
hint?: string;
messages?: string[];
messagesCount?: number;
error?: boolean;
} & Record<string, any>;
}

export default Input;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { SvelteComponent } from 'svelte';

declare class MaterialApp extends SvelteComponent {
$$prop_def: {
theme?: string;
} & Record<string, any>;
}

export default MaterialApp;
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { SvelteComponent } from 'svelte';
import { TransitionConfig } from 'svelte/transition';

declare class MaterialApp extends SvelteComponent {
$$prop_def: {
class?: string;
width?: string;
active?: boolean;
fixed?: boolean;
absolute?: boolean;
right?: boolean;
mini?: boolean;
clipped?: boolean;
noBorder?: boolean;
miniWidth?: string;
clippedHeight?: string;
transition?: (node: Element, options: Record<string, any>) => TransitionConfig; // Svelte transition???
transitionOpts?: Record<string, any>;
style?: string;
} & Record<string, any>;
}

export default MaterialApp;
16 changes: 16 additions & 0 deletions packages/svelte-materialify/@types/components/Overlay.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { SvelteComponent } from 'svelte';

declare class Overlay extends SvelteComponent {
$$prop_def: {
class?: string;
active?: boolean;
opacity?: number;
color?: string;
index?: number;
absolute?: boolean;
fadeOptions?: any;
style?: string;
} & Record<string, any>;
}

export default Overlay;
50 changes: 50 additions & 0 deletions packages/svelte-materialify/@types/components/TextField.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { SvelteComponent } from 'svelte';

declare class TextField extends SvelteComponent {
$$prop_def: {
// Value of the text input.
value?: string;
// The color of the input when active.
color?: string;
// Changes the variant of the input to filled.
filled?: boolean;
// Changes the variant of the input to solo.
solo?: boolean;
// Changes the variant of the input to outlined.
outlined?: boolean;
// Removes any shadow from the input.
flat?: boolean;
// Reduces the input height.
dense?: boolean;
// Adds a border radius to the input.
rounded?: boolean;
// Add input clear functionality.
clearable?: boolean;
// Puts input in readonly state.
readonly?: boolean;
// Disable the input.
disabled?: boolean;
// The input placeholder content.
placeholder?: string;
// Hint text.
hint?: string;
/**
* Creates counter for input length.
* @type {number}
*/
counter?: number;
/**
* An array of functions which take input value as arguement and return error message.
* @type {Array}
*/
rules: ((value) => string | false)[];
// Delays validation till blur.
validateOnBlur: boolean;
// Error state of the input.
error: boolean;
// Id of the text input.
id?: string;
} & Record<string, any>;
}

export default TextField;
18 changes: 18 additions & 0 deletions packages/svelte-materialify/@types/components/card/card.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { SvelteComponent } from 'svelte';

declare class Card extends SvelteComponent {
$$prop_def: {
class?: string;
flat?: boolean;
tile?: boolean;
outlined?: boolean;
raised?: boolean;
shaped?: boolean;
hover?: boolean;
link?: boolean;
disabled?: boolean;
style?: string;
} & Record<string, any>;
}

export default Card;
16 changes: 16 additions & 0 deletions packages/svelte-materialify/@types/components/list/List.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { SvelteComponent } from 'svelte';

declare class List extends SvelteComponent {
$$prop_def: {
class?: string;
dense?: boolean;
disabled?: boolean;
flat?: boolean;
rounded?: boolean;
nav?: boolean;
outlined?: boolean;
style?: string;
} & Record<string, any>;
}

export default List;
18 changes: 18 additions & 0 deletions packages/svelte-materialify/@types/components/list/ListGroup.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { SvelteComponent } from 'svelte';
import { TransitionConfig } from 'svelte/transition';

declare class ListGroup extends SvelteComponent {
$$prop_def: {
class?: string;
active?: boolean;
eager?: boolean;
transition?: (node: Element, options: Record<string, any>) => TransitionConfig; // Svelte transition???
transitionOpts?: Record<string, any>;
offset?: boolean;
disabled?: boolean;
ripple?: any;
style?: string;
} & Record<string, any>;
}

export default ListGroup;
16 changes: 16 additions & 0 deletions packages/svelte-materialify/@types/components/list/ListItem.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { SvelteComponent } from 'svelte';

declare class ListItem extends SvelteComponent {
$$prop_def: {
class?: string;
activeClass?: string;
active?: boolean;
value?: any;
dense?: boolean;
disabled?: boolean;
selectable?: boolean;
ripple?: any;
} & Record<string, any>;
}

export default ListItem;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { SvelteComponent } from 'svelte';

declare class ListItemGroup extends SvelteComponent {
$$prop_def: {
class?: string;
value?: any;
multiple?: boolean;
mandatory?: boolean;
max?: number;
style?: string;
} & Record<string, any>;
}

export default ListItemGroup;
14 changes: 14 additions & 0 deletions packages/svelte-materialify/@types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,17 @@ export { default as ClickOutside } from './ClickOutside';
export { default as Intersect } from './Intersect';
export { default as Jump } from './Jump';
export { default as Touch } from './Touch';

export { default as AppBar } from './components/AppBar';
export { default as Button } from './components/Button';
export { default as Card } from './components/card/Card';
export { default as Icon } from './components/Icon';
export { default as Input } from './components/Input';
export { default as List } from './components/list/List';
export { default as ListGroup } from './components/list/ListGroup';
export { default as ListItem } from './components/list/ListItem';
export { default as ListItemGroup } from './components/list/ListItemGroup';
export { default as MaterialApp } from './components/MaterialApp';
export { default as NavigationDrawer } from './components/NavigationDrawer';
export { default as Overlay } from './components/Overlay';
export { default as TextField } from './components/TextField';

0 comments on commit e2c6e67

Please sign in to comment.