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

Commit

Permalink
feat: rearrange types
Browse files Browse the repository at this point in the history
  • Loading branch information
TheComputerM committed Sep 27, 2020
1 parent 49b4038 commit ad432d9
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalSvelteComponent } from '../shared';
import { SvelteComponent } from './shared';

interface AppBarProps {
height?: string;
Expand All @@ -12,6 +12,6 @@ interface AppBarProps {
style?: string;
}

declare class AppBar extends LocalSvelteComponent<AppBarProps> {}
declare class AppBar extends SvelteComponent<AppBarProps> {}

export default AppBar;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LocalSvelteComponent } from '../shared';
import { SvelteComponent } from './shared';
import { RippleOptions } from './Ripple';

interface ButtonProps {
fab?: boolean;
Expand All @@ -14,10 +15,10 @@ interface ButtonProps {
active?: boolean;
activeClass?: string;
type?: 'button' | 'reset' | 'submit';
ripple?: any;
ripple?: RippleOptions;
style?: string;
}

declare class Button extends LocalSvelteComponent<ButtonProps> {}
declare class Button extends SvelteComponent<ButtonProps> {}

export default Button;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalSvelteComponent } from '../../shared';
import { SvelteComponent } from './shared';

interface CardProps {
flat?: boolean;
Expand All @@ -12,6 +12,6 @@ interface CardProps {
style?: string;
}

declare class Card extends LocalSvelteComponent<CardProps> {}
declare class Card extends SvelteComponent<CardProps> {}

export default Card;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalSvelteComponent } from '../shared';
import { SvelteComponent } from './shared';

interface IconProps {
size?: string;
Expand All @@ -10,6 +10,6 @@ interface IconProps {
style?: string;
}

declare class Icon extends LocalSvelteComponent<IconProps> {}
declare class Icon extends SvelteComponent<IconProps> {}

export default Icon;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalSvelteComponent } from '../shared';
import { SvelteComponent } from './shared';

interface InputProps {
value?: any;
Expand All @@ -13,6 +13,6 @@ interface InputProps {
error?: boolean;
}

declare class Input extends LocalSvelteComponent<InputProps> {}
declare class Input extends SvelteComponent<InputProps> {}

export default Input;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalSvelteComponent } from '../../shared';
import { SvelteComponent } from './shared';

interface ListProps {
dense?: boolean;
Expand All @@ -10,6 +10,6 @@ interface ListProps {
style?: string;
}

declare class List extends LocalSvelteComponent<ListProps> {}
declare class List extends SvelteComponent<ListProps> {}

export default List;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LocalSvelteComponent } from '../../shared';
import { SvelteComponent } from './shared';
import { RippleOptions } from './Ripple';

interface ListGroupProps {
active?: boolean;
Expand All @@ -7,10 +8,10 @@ interface ListGroupProps {
transitionOpts?: Record<string, any>;
offset?: boolean;
disabled?: boolean;
ripple?: any;
ripple?: RippleOptions;
style?: string;
}

declare class ListGroup extends LocalSvelteComponent<ListGroupProps> {}
declare class ListGroup extends SvelteComponent<ListGroupProps> {}

export default ListGroup;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LocalSvelteComponent } from '../../shared';
import { SvelteComponent } from './shared';
import { RippleOptions } from './Ripple';

interface ListItemProps {
class?: string;
Expand All @@ -8,9 +9,10 @@ interface ListItemProps {
dense?: boolean;
disabled?: boolean;
selectable?: boolean;
ripple?: any;
ripple?: RippleOptions;
style?: string;
}

declare class ListItem extends LocalSvelteComponent<ListItemProps> {}
declare class ListItem extends SvelteComponent<ListItemProps> {}

export default ListItem;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalSvelteComponent } from '../../shared';
import { SvelteComponent } from './shared';

interface ListItemGroupProps {
value?: any;
Expand All @@ -8,6 +8,6 @@ interface ListItemGroupProps {
style?: string;
}

declare class ListItemGroup extends LocalSvelteComponent<ListItemGroupProps> {}
declare class ListItemGroup extends SvelteComponent<ListItemGroupProps> {}

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

interface MaterialAppProps {
theme?: string;
}

declare class MaterialApp extends SvelteComponent<MaterialAppProps> {}

export default MaterialApp;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalSvelteComponent } from '../shared';
import { SvelteComponent } from './shared';

interface NavigationDrawerProps {
width?: string;
Expand All @@ -16,6 +16,6 @@ interface NavigationDrawerProps {
style?: string;
}

declare class NavigationDrawer extends LocalSvelteComponent<NavigationDrawerProps> {}
declare class NavigationDrawer extends SvelteComponent<NavigationDrawerProps> {}

export default NavigationDrawer;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalSvelteComponent } from '../shared';
import { SvelteComponent } from './shared';

interface OverlayProps {
active?: boolean;
Expand All @@ -10,6 +10,6 @@ interface OverlayProps {
style?: string;
}

declare class Overlay extends LocalSvelteComponent<OverlayProps> {}
declare class Overlay extends SvelteComponent<OverlayProps> {}

export default Overlay;
2 changes: 1 addition & 1 deletion packages/svelte-materialify/@types/Ripple.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
interface RippleOptions {
export interface RippleOptions {
color?: string;
class?: string;
opacity?: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalSvelteComponent } from '../shared';
import { SvelteComponent } from './shared';

interface TextFieldProps {
// Value of the text input.
Expand Down Expand Up @@ -27,15 +27,9 @@ interface TextFieldProps {
placeholder?: string;
// Hint text.
hint?: string;
/**
* Creates counter for input length.
* @type {number}
*/
// Creates counter for input length.
counter?: number;
/**
* An array of functions which take input value as arguement and return error message.
* @type {Array}
*/
// An array of functions which take input value as arguement and return error message.
rules: ((value) => string | false)[];
// Delays validation till blur.
validateOnBlur: boolean;
Expand All @@ -45,6 +39,6 @@ interface TextFieldProps {
id?: string;
}

declare class TextField extends LocalSvelteComponent<TextFieldProps> {}
declare class TextField extends SvelteComponent<TextFieldProps> {}

export default TextField;

This file was deleted.

2 changes: 1 addition & 1 deletion packages/svelte-materialify/@types/shared.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type LocalSvelteProps = {
* Local svelte class for adding typescript definitions for svelte components
*
*/
export declare class LocalSvelteComponent<Props = {}> {
export declare class SvelteComponent<Props = {}> {
constructor(props: Props & LocalSvelteProps);
$on<T = any>(event: string, callback: (event: CustomEvent<T>) => void): () => void;
$$prop_def: Props & LocalSvelteProps;
Expand Down

1 comment on commit ad432d9

@vercel
Copy link

@vercel vercel bot commented on ad432d9 Sep 27, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.