Convert index to TS

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-09-27 14:44:43 +02:00
parent e2b6c2cbd6
commit de44b3aacc
No known key found for this signature in database
GPG Key ID: 55C211A1226CB17D
2 changed files with 8 additions and 7 deletions

View File

@ -25,9 +25,9 @@
"bin": {
"reskindex": "scripts/reskindex.js"
},
"main": "./src/index.js",
"matrix_src_main": "./src/index.js",
"matrix_lib_main": "./lib/index.js",
"main": "./src/index.ts",
"matrix_src_main": "./src/index.ts",
"matrix_lib_main": "./lib/index.ts",
"matrix_lib_typings": "./lib/index.d.ts",
"scripts": {
"prepublishOnly": "yarn build",

View File

@ -15,20 +15,21 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import Skinner from './Skinner';
import Skinner, { ISkinObject } from './Skinner';
export function loadSkin(skinObject) {
export function loadSkin(skinObject: ISkinObject): void {
Skinner.load(skinObject);
}
export function resetSkin() {
export function resetSkin(): void {
Skinner.reset();
}
export function getComponent(componentName) {
export function getComponent(componentName: string): any {
return Skinner.getComponent(componentName);
}
// Import the js-sdk so the proper `request` object can be set. This does some
// magic with the browser injection to make all subsequent imports work fine.
import "matrix-js-sdk";