-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: improve typings of addons/viewport
- Loading branch information
1 parent
1925520
commit 2c5b08f
Showing
10 changed files
with
146 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
export const ADDON_ID = 'storybook/viewport'; | ||
export const PARAM_KEY = 'viewport'; | ||
|
||
export default { | ||
UPDATE: `${ADDON_ID}/update`, | ||
CONFIGURE: `${ADDON_ID}/configure`, | ||
SET: `${ADDON_ID}/setStoryDefaultViewport`, | ||
CHANGED: `${ADDON_ID}/viewportChanged`, | ||
}; | ||
export const UPDATE = `${ADDON_ID}/update`; | ||
export const CONFIGURE = `${ADDON_ID}/configure`; | ||
export const SET = `${ADDON_ID}/setStoryDefaultViewport`; | ||
export const CHANGED = `${ADDON_ID}/viewportChanged`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import deprecate from 'util-deprecate'; | ||
|
||
export { INITIAL_VIEWPORTS, DEFAULT_VIEWPORT } from '../defaults'; | ||
export { default as withViewport } from './withViewport'; | ||
|
||
export const configureViewport = deprecate(() => {}, | ||
'configureViewport is no longer supported, use .addParameters({ viewport }) instead'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export interface Viewport { | ||
name: string; | ||
styles: ViewportStyles; | ||
type: 'desktop' | 'mobile' | 'tablet'; | ||
/* | ||
* @deprecated | ||
* Deprecated option? | ||
*/ | ||
default?: boolean; | ||
} | ||
|
||
export interface ViewportStyles { | ||
height: string; | ||
width: string; | ||
} | ||
|
||
export interface ViewportMap { | ||
[key: string]: Viewport; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { ViewportMap } from './Viewport'; | ||
|
||
export interface ViewportAddonParameter { | ||
disable: boolean; | ||
defaultViewport: string; | ||
viewports: ViewportMap; | ||
/* | ||
* @deprecated | ||
* The viewport parameter `onViewportChange` is no longer supported | ||
*/ | ||
onViewportChange?: never; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './Viewport'; | ||
export * from './ViewportAddonParameter'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters