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"; +