@@ -54,9 +54,8 @@ export interface SubAPI {
54
54
type PartialSubState = Partial < SubState > ;
55
55
type PartialThemeVars = Partial < ThemeVars > ;
56
56
type PartialLayout = Partial < Layout > ;
57
- type PartialUI = Partial < UI > ;
58
57
59
- interface Options extends ThemeVars {
58
+ export interface UIOptions {
60
59
name ?: string ;
61
60
url ?: string ;
62
61
goFullScreen : boolean ;
@@ -96,16 +95,19 @@ const deprecationMessage = (optionsMap: OptionsMap, prefix = '') =>
96
95
prefix ? `${ prefix } 's` : ''
97
96
} { ${ Object . values ( optionsMap ) . join ( ', ' ) } } instead.`;
98
97
99
- const applyDeprecatedThemeOptions = deprecate ( ( { name, url, theme } : Options ) : PartialThemeVars => {
100
- const { brandTitle, brandUrl, brandImage } : PartialThemeVars = theme || { } ;
101
- return {
102
- brandTitle : brandTitle || name ,
103
- brandUrl : brandUrl || url ,
104
- brandImage : brandImage || null ,
105
- } ;
106
- } , deprecationMessage ( deprecatedThemeOptions ) ) ;
98
+ const applyDeprecatedThemeOptions = deprecate (
99
+ ( { name, url, theme } : UIOptions ) : PartialThemeVars => {
100
+ const { brandTitle, brandUrl, brandImage } : PartialThemeVars = theme || { } ;
101
+ return {
102
+ brandTitle : brandTitle || name ,
103
+ brandUrl : brandUrl || url ,
104
+ brandImage : brandImage || null ,
105
+ } ;
106
+ } ,
107
+ deprecationMessage ( deprecatedThemeOptions )
108
+ ) ;
107
109
108
- const applyDeprecatedLayoutOptions = deprecate ( ( options : Partial < Options > ) : PartialLayout => {
110
+ const applyDeprecatedLayoutOptions = deprecate ( ( options : Partial < UIOptions > ) : PartialLayout => {
109
111
const layoutUpdate : PartialLayout = { } ;
110
112
111
113
[ 'goFullScreen' , 'showStoriesPanel' , 'showAddonPanel' ] . forEach (
@@ -123,14 +125,14 @@ const applyDeprecatedLayoutOptions = deprecate((options: Partial<Options>): Part
123
125
return layoutUpdate ;
124
126
} , deprecationMessage ( deprecatedLayoutOptions ) ) ;
125
127
126
- const checkDeprecatedThemeOptions = ( options : Options ) => {
128
+ const checkDeprecatedThemeOptions = ( options : UIOptions ) => {
127
129
if ( Object . keys ( deprecatedThemeOptions ) . find ( v => v in options ) ) {
128
130
return applyDeprecatedThemeOptions ( options ) ;
129
131
}
130
132
return { } ;
131
133
} ;
132
134
133
- const checkDeprecatedLayoutOptions = ( options : Partial < Options > ) => {
135
+ const checkDeprecatedLayoutOptions = ( options : Partial < UIOptions > ) => {
134
136
if ( Object . keys ( deprecatedLayoutOptions ) . find ( v => v in options ) ) {
135
137
return applyDeprecatedLayoutOptions ( options ) ;
136
138
}
0 commit comments