Convert index to TS

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Š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": { "bin": {
"reskindex": "scripts/reskindex.js" "reskindex": "scripts/reskindex.js"
}, },
"main": "./src/index.js", "main": "./src/index.ts",
"matrix_src_main": "./src/index.js", "matrix_src_main": "./src/index.ts",
"matrix_lib_main": "./lib/index.js", "matrix_lib_main": "./lib/index.ts",
"matrix_lib_typings": "./lib/index.d.ts", "matrix_lib_typings": "./lib/index.d.ts",
"scripts": { "scripts": {
"prepublishOnly": "yarn build", "prepublishOnly": "yarn build",

View file

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