From de44b3aacc34458b9539316351b3c9df38d36bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Mon, 27 Sep 2021 14:44:43 +0200 Subject: [PATCH] Convert index to TS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- package.json | 6 +++--- src/{index.js => index.ts} | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) rename src/{index.js => index.ts} (81%) diff --git a/package.json b/package.json index 3e3d9383c4..bb1d2a38fd 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.js b/src/index.ts similarity index 81% rename from src/index.js rename to src/index.ts index e360c04f4f..2c88265438 100644 --- a/src/index.js +++ b/src/index.ts @@ -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"; +