Skip to content

Commit 822b149

Browse files
committed
TypeScript Support (#337)
1 parent a57f8aa commit 822b149

23 files changed

+4342
-49
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ node_modules
33
.idea
44
support/lib
55
support/polyfills
6+
7+
# Prevent `tsc` generated typescript types from ended up in the repo
8+
/types
9+
10+
# Type Docs
11+
/typedocs

index.d.ts

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
/*
2+
* If not stated otherwise in this file or this component's LICENSE file the
3+
* following copyright and licenses apply:
4+
*
5+
* Copyright 2022 Metrological
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the License);
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
import { FontFaceDefinition } from './src/Application/index.js';
20+
import { RouterPlatformSettings } from './src/Router/index.js';
21+
export const Ads: any; // export { default as Ads } from './src/Ads'
22+
export { AppData, FontFaceDefinition } from './src/Application/index.js';
23+
export { default as Application } from './src/Application/index.js';
24+
export const AudioPlayer: any; // export { default as AudioPlayer } from './src/AudioPlayer'
25+
export const Colors: any; // export { default as Colors } from './src/Colors'
26+
export { default as Img } from './src/Img/index.js';
27+
export const Keyboard: any; // export { default as Keyboard } from './src/Keyboard'
28+
export { default as Launch } from './src/Launch/index.js';
29+
export { default as Lightning } from './src/Lightning/index.js';
30+
export const Locale: any; // export { default as Locale } from './src/Locale'
31+
export const Language: any; // export { default as Language } from './src/Language'
32+
export const Log: any; // export { default as Log } from './src/Log'
33+
export const MediaPlayer: any; // export { default as MediaPlayer } from './src/MediaPlayer'
34+
export const Metrics: any; // export { default as Metrics } from './src/Metrics'
35+
export const Pin: any; // export { default as Pin } from './src/Pin'
36+
export const Profile: any; // export { default as Profile } from './src/Profile'
37+
export const Purchase: any; // export { default as Purchase } from './src/Purchase'
38+
export const Registry: any; // export { default as Registry } from './src/Registry'
39+
export { default as Router } from './src/Router/index.js';
40+
export const Settings: any; // export { default as Settings } from './src/Settings'
41+
export const Storage: any; // export { default as Storage } from './src/Storage'
42+
export const TV: any; // export { default as TV } from './src/TV'
43+
export { default as Utils } from './src/Utils/index.js';
44+
export const VideoPlayer: any; // export { default as VideoPlayer } from './src/VideoPlayer'
45+
export const Metadata: any; // export { default as Metadata } from './src/Metadata'
46+
47+
/**
48+
* [Platform Settings](https://lightningjs.io/docs/#/lightning-sdk-reference/plugins/settings?id=platform-settings)
49+
*/
50+
export interface PlatformSettings {
51+
plugins?: {
52+
profile?: any;
53+
metrics?: any;
54+
mediaPlayer?: any;
55+
ads?: any;
56+
router?: any;
57+
tv?: any;
58+
purchase?: any;
59+
pin?: any;
60+
};
61+
/**
62+
* The target ECMAScript environment for the App.
63+
*/
64+
esEnv?: 'es5' | 'es6';
65+
/**
66+
* If set to `true`, initializes the Lightning Inspector
67+
*
68+
* @remarks
69+
* The Lightning Inspector renders out a HTML structure inside the DOM to mimic the canvas.
70+
*
71+
* @defaultValue `false`
72+
*/
73+
inspector?: boolean;
74+
75+
/**
76+
* If set to `true`, shows a frames-per-second indicator on the top-left corner of the screen
77+
*
78+
* @defaultValue `false`
79+
*/
80+
showFps?: boolean;
81+
/**
82+
* Custom font loader
83+
*
84+
* @param fontsToLoad
85+
* @param store Add loaded [FontFace](https://developer.mozilla.org/en-US/docs/Web/API/FontFace) instances to this array
86+
*/
87+
fontLoader?(fontsToLoad: FontFaceDefinition[], store: FontFace[]): void;
88+
/**
89+
* If set to `true`, shows the active versions of Lightning Core and SDK on the bottom-right corner of the screen
90+
*
91+
* @defaultValue `false`
92+
*/
93+
showVersion?: boolean;
94+
95+
/**
96+
* If set to `true`, enables console logging in the Log plugin
97+
*
98+
* @remarks
99+
* See [Log](https://lightningjs.io/docs/#/lightning-sdk-reference/plugins/log)
100+
* for more information.
101+
*
102+
*/
103+
log?: boolean;
104+
105+
onClose?: any;
106+
107+
/**
108+
* Indicates whether or not to render video as a texture on the active drawing
109+
* canvas. Can also be set by adding a queryparam ?texture.
110+
*
111+
* @remarks
112+
* Used by the [VideoPlayer](https://lightningjs.io/docs/#/lightning-sdk-reference/plugins/videoplayer?id=videoplayer)
113+
* plugin.
114+
*
115+
* @defaultValue `false`
116+
*/
117+
textureMode?: boolean;
118+
119+
/**
120+
* Path to the folder where the assets of the App are located. The path
121+
* is used by Utils.asset() to look up assets.
122+
*
123+
* @remarks
124+
* See [Utils](https://lightningjs.io/docs/#/lightning-sdk-reference/plugins/utils?id=utils)
125+
* for more information.
126+
*/
127+
path?: string;
128+
/**
129+
* Router plugin settings
130+
*
131+
* @remarks
132+
* See [Router Settings](https://lightningjs.io/docs/#/lightning-sdk-reference/plugins/router/settings?id=router-settings)
133+
* for more information.
134+
*/
135+
router?: RouterPlatformSettings;
136+
/**
137+
* Image plugin settings
138+
*
139+
* See [Image plugin](https://lightningjs.io/docs/#/lightning-sdk-reference/plugins/image?id=image)
140+
* for more information.
141+
*/
142+
image?: {
143+
/**
144+
* Image plugin quality
145+
*
146+
* @remarks
147+
* Depending on this setting, the images that are returned by the image server will be smaller
148+
* than actually displayed on the screen. Lightning stretches the images to fit them within the
149+
* desired dimensions.
150+
*
151+
* The Platform Setting image.quality is a value between 1 and 100, where 1 means low quality and
152+
* 100 is the original image quality.
153+
*
154+
* See [Image plugin](https://lightningjs.io/docs/#/lightning-sdk-reference/plugins/image?id=image)
155+
* for more information.
156+
*/
157+
quality?: number
158+
}
159+
}

0 commit comments

Comments
 (0)