diff --git a/assets/typescript/BackgroundAttachment.ts b/assets/typescript/BackgroundAttachment.ts
new file mode 100644
index 00000000..4ad91249
--- /dev/null
+++ b/assets/typescript/BackgroundAttachment.ts
@@ -0,0 +1,7 @@
+enum BackgroundAttachment {
+ None = 0,
+ Cover,
+ Stretch,
+ Tile,
+ Contain,
+}
diff --git a/assets/typescript/Colour.ts b/assets/typescript/Colour.ts
new file mode 100644
index 00000000..06a19c1e
--- /dev/null
+++ b/assets/typescript/Colour.ts
@@ -0,0 +1,77 @@
+class Colour {
+ public static readonly INHERIT: number = 0x40000000;
+ public static readonly READABILITY_THRESHOLD: number = 186;
+ public static readonly LUMINANCE_WEIGHT_RED: number = 0.299;
+ public static readonly LUMINANCE_WEIGHT_GREEN: number = 0.587;
+ public static readonly LUMINANCE_WEIGHT_BLUE: number = 0.114;
+
+ public raw: number;
+
+ public constructor(rawColour: number = 0)
+ {
+ this.raw = rawColour === null ? Colour.INHERIT : rawColour;
+ }
+
+ public static none(): Colour {
+ return new Colour(Colour.INHERIT);
+ }
+
+ public get inherit(): boolean {
+ return (this.raw & Colour.INHERIT) > 0;
+ }
+
+ public set inherit(inherit: boolean) {
+ if (inherit) {
+ this.raw |= Colour.INHERIT;
+ } else {
+ this.raw &= ~Colour.INHERIT;
+ }
+ }
+
+ public get red(): number {
+ return (this.raw >> 16) & 0xFF;
+ }
+
+ public set red(red: number) {
+ red = red & 0xFF;
+ this.raw &= ~0xFF0000;
+ this.raw |= red << 16;
+ }
+
+ public get green(): number {
+ return (this.raw >> 8) & 0xFF;
+ }
+
+ public set green(green: number) {
+ green = green & 0xFF;
+ this.raw &= ~0xFF00;
+ this.raw |= green << 8;
+ }
+
+ public get blue(): number {
+ return this.raw & 0xFF;
+ }
+
+ public set blue(blue: number) {
+ blue = blue & 0xFF;
+ this.raw &= ~0xFF;
+ this.raw |= blue;
+ }
+
+ public get luminance(): number {
+ return Colour.LUMINANCE_WEIGHT_RED * this.red
+ + Colour.LUMINANCE_WEIGHT_GREEN * this.green
+ + Colour.LUMINANCE_WEIGHT_BLUE * this.blue;
+ }
+
+ public get hex(): string
+ {
+ let hex: string = (this.raw & 0xFFFFFF).toString(16);
+
+ if (hex.length < 6)
+ for (let i = 0; i < 6 - hex.length; i++)
+ hex = '0' + hex;
+
+ return '#' + hex;
+ }
+}
diff --git a/assets/typescript/CurrentUserInfo.ts b/assets/typescript/CurrentUserInfo.ts
index e3b6f45b..fd62aeed 100644
--- a/assets/typescript/CurrentUserInfo.ts
+++ b/assets/typescript/CurrentUserInfo.ts
@@ -1,4 +1,4 @@
-export default interface CurrentUserInfo {
+interface CurrentUserInfo {
user_id: number;
username: string;
user_background_settings: number;
diff --git a/assets/typescript/Support.ts b/assets/typescript/Support.ts
new file mode 100644
index 00000000..07109b06
--- /dev/null
+++ b/assets/typescript/Support.ts
@@ -0,0 +1,6 @@
+// Collection class for support checks.
+class Support {
+ public static get sidewaysText(): boolean {
+ return CSS.supports('writing-mode', 'sideways-lr');
+ }
+}
diff --git a/assets/typescript/misuzu.ts b/assets/typescript/misuzu.ts
index 3cc88aaf..5d65e731 100644
--- a/assets/typescript/misuzu.ts
+++ b/assets/typescript/misuzu.ts
@@ -1,22 +1,67 @@
-import CurrentUserInfo from 'CurrentUserInfo';
+///