Browse Source

Move DeviceManager config to TS

pull/4695/head
Artur Arseniev 4 years ago
parent
commit
abc3c6ee36
  1. 31
      src/device_manager/config/config.js
  2. 55
      src/device_manager/config/config.ts

31
src/device_manager/config/config.js

@ -1,31 +0,0 @@
export default {
// The device `id` to select on start, if not indicated, the first available from `devices` will be used.
default: null,
// Default devices
devices: [
{
id: 'desktop',
name: 'Desktop',
width: '',
},
{
id: 'tablet',
name: 'Tablet',
width: '770px',
widthMedia: '992px',
},
{
id: 'mobileLandscape',
name: 'Mobile landscape',
width: '568px',
widthMedia: '768px',
},
{
id: 'mobilePortrait',
name: 'Mobile portrait',
width: '320px',
widthMedia: '480px',
},
],
};

55
src/device_manager/config/config.ts

@ -0,0 +1,55 @@
export interface DeviceManagerConfig {
/**
* The device `id` to select on start, if not indicated, the first available from `devices` will be used.
* @default ''
*/
default?: string;
/**
* Default devices.
* @example
* devices: [{
* id: 'desktop',
* name: 'Desktop',
* width: '',
* }, {
* id: 'tablet',
* name: 'Tablet',
* width: '770px',
* widthMedia: '992px',
* },
* ...
* ]
*/
devices?: Array<object>; // TODO
}
const config: DeviceManagerConfig = {
default: '',
devices: [
{
id: 'desktop',
name: 'Desktop',
width: '',
},
{
id: 'tablet',
name: 'Tablet',
width: '770px',
widthMedia: '992px',
},
{
id: 'mobileLandscape',
name: 'Mobile landscape',
width: '568px',
widthMedia: '768px',
},
{
id: 'mobilePortrait',
name: 'Mobile portrait',
width: '320px',
widthMedia: '480px',
},
],
};
export default config;
Loading…
Cancel
Save