mirror of https://github.com/zer0bin-dev/zer0bin
TypeScipt 🚀
This commit is contained in:
parent
305b8b34a8
commit
4528b4efd2
35
README.md
35
README.md
|
@ -24,41 +24,45 @@
|
|||
Submit your public instance [here](https://github.com/Domterion/zer0bin/issues/new?assignees=&labels=&template=03_public_instance.md&title=%F0%9F%9A%80+)!
|
||||
|
||||
| Website | Expiration | Max paste size | Version | Country |
|
||||
| ---------------------------------------------- | ---------- | ---------------| --------| ------- |
|
||||
| ---------------------------------------------- | ---------- | -------------- | ------- | ------- |
|
||||
| zer0b.in (not up yet) | 7 days | 40,000 chars | vx.x.x | ? |
|
||||
| [stepbro.voring.me](https://stepbro.voring.me) | 365 days | 69,000 chars | v0.3.1 | 🇺🇸 US |
|
||||
|
||||
# Technologies used
|
||||
|
||||
### Frontend:
|
||||
<a href="https://www.javascript.com/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/JavaScript.svg" height=40/></a> <a href="https://sass-lang.com/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Sass.svg" height=40/></a> <a href="https://pugjs.org/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Pug-Dark.svg" height=40/></a> <a href="https://rosepinetheme.com/"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953176309444542464/RosePine.svg" height=40/></a> <a href="https://jquery.com/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/JQuery.svg" height=40/></a> <a href="https://highlightjs.org/"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953177926688464936/HLJS.svg" height=40/></a> <a href="https://github.com/ant-design/ant-design-icons"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953181625259266059/AntIcons-Dark.svg" height=40/></a> <a href="https://parceljs.org/"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953176310195322920/Parcel-Dark.svg" height=40/></a> <a href="https://npmjs.org"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953176309259972638/NPM.svg" height=40/></a>
|
||||
|
||||
<a href="https://www.typescriptlang.org/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/TypeScript.svg" height=40/></a> <a href="https://sass-lang.com/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Sass.svg" height=40/></a> <a href="https://pugjs.org/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Pug-Dark.svg" height=40/></a> <a href="https://rosepinetheme.com/"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953176309444542464/RosePine.svg" height=40/></a> <a href="https://jquery.com/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/JQuery.svg" height=40/></a> <a href="https://highlightjs.org/"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953177926688464936/HLJS.svg" height=40/></a> <a href="https://github.com/ant-design/ant-design-icons"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953181625259266059/AntIcons-Dark.svg" height=40/></a> <a href="https://parceljs.org/"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953176310195322920/Parcel-Dark.svg" height=40/></a> <a href="https://npmjs.org"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953176309259972638/NPM.svg" height=40/></a>
|
||||
|
||||
### Backend:
|
||||
|
||||
<a href="https://www.rust-lang.org/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Rust.svg" height=40/></a> <a href="https://actix.rs/"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953176309813628978/Actix-Dark.svg" height=40/></a> <a href="https://github.com/serde-rs/serde"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953176309964627978/Serde-Dark.svg" height=40/></a> <a href="https://github.com/launchbadge/sqlx"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953176310354673704/SQLX-Dark.svg" height=40/></a> <a href="https://github.com/chronotope/chrono"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953178919169835018/NPM-svg.png" height=40/></a> <a href="https://www.postgresql.org/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/PostgreSQL-Dark.svg" height=40/></a> <a href="https://github.com/ai/nanoid"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953176309629067354/NanoID-Dark.svg" height=40/></a>
|
||||
|
||||
### Misc:
|
||||
<a href="https://nginx.com/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Nginx.svg" height=40/></a> <a href="https://docker.com/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Docker.svg" height=40/></a> <a href="https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Markdown-Dark.svg" height=40/></a> <a href="https://prettier.io/"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953339670538887318/Prettier.svg" height=40/></a> <a href="https://git-scm.com/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Git.svg" height=40/></a> <a href="https://www.kernel.org/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Linux-Dark.svg" height=40/></a>
|
||||
|
||||
<a href="https://nginx.com/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Nginx.svg" height=40/></a> <a href="https://docker.com/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Docker.svg" height=40/></a> <a href="https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Markdown-Dark.svg" height=40/></a> <a href="https://prettier.io/"><img src="https://cdn.discordapp.com/attachments/810799100940255260/953339670538887318/Prettier.svg" height=40/></a> <a href="https://git-scm.com/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Git.svg" height=40/></a> <a href="https://www.kernel.org/"><img src="https://github.com/tandpfun/skill-icons/raw/main/icons/Linux-Dark.svg" height=40/></a>
|
||||
|
||||
# API
|
||||
|
||||
- **GET** `/api/p/:id` - Get a paste by ID
|
||||
- **POST** `/api/p/n` - Post a new paste
|
||||
- **GET** `/api/s` - Get stats about the instance
|
||||
- **GET** `/api/p/:id` - Get a paste by ID
|
||||
- **POST** `/api/p/n` - Post a new paste
|
||||
- **GET** `/api/s` - Get stats about the instance
|
||||
|
||||
# Self-host instructions
|
||||
|
||||
### Requirements
|
||||
|
||||
- 🦀 Rust ≥ 1.58.0
|
||||
- 🚢 Cargo ≥ 1.58.0
|
||||
- 🐢 NodeJS ≥ 16.0
|
||||
- 🚀 NPM ≥ 8.0.0
|
||||
- 🐘 PostgreSQL ≥ 9.6
|
||||
- 🦝 Nginx ≥ 1.18.0
|
||||
- 🌄 Domain with [SSL](https://letsencrypt.org/)
|
||||
- 🐧 \*nix OS
|
||||
- 🦀 Rust ≥ 1.58.0
|
||||
- 🚢 Cargo ≥ 1.58.0
|
||||
- 🐢 NodeJS ≥ 16.0
|
||||
- 🚀 NPM ≥ 8.0.0
|
||||
- 🐘 PostgreSQL ≥ 9.6
|
||||
- 🦝 Nginx ≥ 1.18.0
|
||||
- 🌄 Domain with [SSL](https://letsencrypt.org/)
|
||||
- 🐧 \*nix OS
|
||||
|
||||
### Steps
|
||||
|
||||
<!--
|
||||
1. `git clone https://github.com/Domterion/zer0bin && cd zer0bin`
|
||||
2. Edit `example.nginx` as appropriate, then `mv example.nginx yourdomain.tld && for i in /etc/nginx/sites-available/ /etc/nginx/sites-enabled/; do cp ./yourdomain.tld $i; done && systemctl nginx restart`
|
||||
|
@ -110,10 +114,13 @@ cargo build --release
|
|||
| ratelimits.allowed_pastes_before_ratelimit | Number up to 2^32 - 1 | Amount of requests that can be made before they are blocked and have to wait |
|
||||
|
||||
# Benchmarks
|
||||
|
||||
> This is on a paste with 200 lines!
|
||||
|
||||
### Lighthouse
|
||||
|
||||
![Lighthouse](https://user-images.githubusercontent.com/44733677/158105961-7e186b86-54a8-44ac-ad81-65d6cd4b8eb2.png)
|
||||
|
||||
### Firefox network
|
||||
|
||||
![Firefox Network](https://user-images.githubusercontent.com/44733677/158106344-71c4bb71-450b-4c9a-8473-05e304da41f3.png)
|
||||
|
|
|
@ -17,7 +17,7 @@ head
|
|||
meta(property='twitter:title' content='zer0bin')
|
||||
meta(property='twitter:description' content='🖊 Just a place to paste')
|
||||
meta(property='twitter:image' content='https://raw.githubusercontent.com/Domterion/zer0bin/main/assets/zero.png')
|
||||
script(defer='' type='module' src='src/index.js')
|
||||
script(defer='' type='module' src='src/index.ts')
|
||||
|
||||
ul.noselect#messages
|
||||
.button-wrapper.noselect(style='position: fixed')
|
||||
|
|
|
@ -11,7 +11,9 @@
|
|||
"devDependencies": {
|
||||
"@parcel/transformer-pug": "^2.3.2",
|
||||
"@parcel/transformer-sass": "^2.3.2",
|
||||
"parcel": "^2.3.2"
|
||||
"@types/core-js": "^2.5.5",
|
||||
"parcel": "^2.3.2",
|
||||
"ts-migrate": "^0.1.28"
|
||||
},
|
||||
"description": "just a place to paste",
|
||||
"repository": "https://github.com/Domterion/zer0bin",
|
||||
|
|
|
@ -3,15 +3,15 @@ import {
|
|||
FileAddOutlined,
|
||||
GithubOutlined,
|
||||
CopyOutlined,
|
||||
} from "@ant-design/icons-svg";
|
||||
import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpers";
|
||||
import hljs from "highlight.js";
|
||||
} from "@ant-design/icons-svg"
|
||||
import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpers"
|
||||
import hljs from "highlight.js"
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'jque... Remove this comment to see the full error message
|
||||
import $ from "jquery";
|
||||
import $ from "jquery"
|
||||
|
||||
// @ts-expect-error ts-migrate(2580) FIXME: Cannot find name 'require'. Do you need to install... Remove this comment to see the full error message
|
||||
const config = require("../config.json");
|
||||
const apiUrl = config.api_url;
|
||||
const config = require("../config.json")
|
||||
const apiUrl = config.api_url
|
||||
|
||||
const svgSave = renderIconDefinitionToSVGElement(SaveOutlined, {
|
||||
extraSVGAttrs: {
|
||||
|
@ -19,7 +19,7 @@ const svgSave = renderIconDefinitionToSVGElement(SaveOutlined, {
|
|||
height: "1em",
|
||||
fill: "currentColor",
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
const svgFileAdd = renderIconDefinitionToSVGElement(FileAddOutlined, {
|
||||
extraSVGAttrs: {
|
||||
|
@ -27,7 +27,7 @@ const svgFileAdd = renderIconDefinitionToSVGElement(FileAddOutlined, {
|
|||
height: "1em",
|
||||
fill: "currentColor",
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
const svgCopy = renderIconDefinitionToSVGElement(CopyOutlined, {
|
||||
extraSVGAttrs: {
|
||||
|
@ -35,7 +35,7 @@ const svgCopy = renderIconDefinitionToSVGElement(CopyOutlined, {
|
|||
height: "1em",
|
||||
fill: "currentColor",
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
const svgGithub = renderIconDefinitionToSVGElement(GithubOutlined, {
|
||||
extraSVGAttrs: {
|
||||
|
@ -43,125 +43,126 @@ const svgGithub = renderIconDefinitionToSVGElement(GithubOutlined, {
|
|||
height: "1em",
|
||||
fill: "currentColor",
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
const lineNumbers = $(".line-numbers");
|
||||
const editor = $("#text-area");
|
||||
const codeViewPre = $("#code-view-pre");
|
||||
const codeView = $("#code-view");
|
||||
const messages = $("#messages");
|
||||
const viewCounterLabel = $("#viewcounter-label");
|
||||
const viewCounter = $("#viewcounter-count");
|
||||
const lineNumbers = $(".line-numbers")
|
||||
const editor = $("#text-area")
|
||||
const codeViewPre = $("#code-view-pre")
|
||||
const codeView = $("#code-view")
|
||||
const messages = $("#messages")
|
||||
const viewCounterLabel = $("#viewcounter-label")
|
||||
const viewCounter = $("#viewcounter-count")
|
||||
|
||||
const saveButton = $("#save-button");
|
||||
const newButton = $("#new-button");
|
||||
const copyButton = $("#copy-button");
|
||||
const githubButton = $("#github-button");
|
||||
const saveButton = $("#save-button")
|
||||
const newButton = $("#new-button")
|
||||
const copyButton = $("#copy-button")
|
||||
const githubButton = $("#github-button")
|
||||
|
||||
saveButton.append(svgSave);
|
||||
newButton.append(svgFileAdd);
|
||||
copyButton.append(svgCopy);
|
||||
githubButton.append(svgGithub);
|
||||
saveButton.append(svgSave)
|
||||
newButton.append(svgFileAdd)
|
||||
copyButton.append(svgCopy)
|
||||
githubButton.append(svgGithub)
|
||||
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'content' implicitly has an 'any' type.
|
||||
function postPaste(content, callback) {
|
||||
const payload = { content };
|
||||
function postPaste(content: string, callback: Function) {
|
||||
const payload = { content }
|
||||
fetch(`${apiUrl}/p/n`, {
|
||||
method: 'POST',
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
}).then(response => response.json())
|
||||
.then(data => {
|
||||
console.log(data);
|
||||
callback(null, data);
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
console.log(data)
|
||||
callback(null, data)
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
callback(error || `{"data": { "message": "An unkown error occured!" } }`);
|
||||
});
|
||||
console.log(error)
|
||||
callback(
|
||||
error || `{"data": { "message": "An unkown error occured!" } }`
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'id' implicitly has an 'any' type.
|
||||
function getPaste(id, callback) {
|
||||
function getPaste(id: string, callback: Function) {
|
||||
fetch(`${apiUrl}/p/${id}`, {
|
||||
method: 'GET',
|
||||
method: "GET",
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
referrerPolicy: 'no-referrer',
|
||||
}).then(response => response.json())
|
||||
.then(data => {
|
||||
callback(null, data);
|
||||
referrerPolicy: "no-referrer",
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
callback(null, data)
|
||||
})
|
||||
.catch((error) => {
|
||||
callback(error || `{"data": { "message": "An unkown error occured!" } }`);
|
||||
});
|
||||
callback(
|
||||
error || `{"data": { "message": "An unkown error occured!" } }`
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
function newPaste() {
|
||||
lineNumbers.html(">");
|
||||
lineNumbers.html(">")
|
||||
|
||||
saveButton.prop("disabled", false);
|
||||
newButton.prop("disabled", true);
|
||||
copyButton.prop("disabled", true);
|
||||
saveButton.prop("disabled", false)
|
||||
newButton.prop("disabled", true)
|
||||
copyButton.prop("disabled", true)
|
||||
|
||||
editor.val("");
|
||||
editor.val("")
|
||||
|
||||
editor.show();
|
||||
codeViewPre.hide();
|
||||
editor.show()
|
||||
codeViewPre.hide()
|
||||
}
|
||||
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'message' implicitly has an 'any' type.
|
||||
function addMessage(message) {
|
||||
let msg = $(`<li>${message}</li>`);
|
||||
messages.prepend(msg);
|
||||
let msg = $(`<li>${message}</li>`)
|
||||
messages.prepend(msg)
|
||||
|
||||
setTimeout(function () {
|
||||
msg.slideUp("fast", function () {
|
||||
// @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message
|
||||
$(this).remove();
|
||||
});
|
||||
}, 3000);
|
||||
// @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message
|
||||
$(this).remove()
|
||||
})
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'content' implicitly has an 'any' type.
|
||||
function viewPaste(content, views) {
|
||||
lineNumbers.html("");
|
||||
function viewPaste(content: string, views: string) {
|
||||
lineNumbers.html("")
|
||||
for (let i = 1; i <= content.split("\n").length; i++) {
|
||||
lineNumbers.append(`${i}
|
||||
<br>`);
|
||||
<br>`)
|
||||
}
|
||||
codeView.html(hljs.highlightAuto(content).value);
|
||||
codeView.html(hljs.highlightAuto(content).value)
|
||||
|
||||
saveButton.prop("disabled", true);
|
||||
newButton.prop("disabled", false);
|
||||
copyButton.prop("disabled", false);
|
||||
saveButton.prop("disabled", true)
|
||||
newButton.prop("disabled", false)
|
||||
copyButton.prop("disabled", false)
|
||||
|
||||
viewCounter.text(views);
|
||||
viewCounter.text(views)
|
||||
|
||||
editor.hide();
|
||||
codeViewPre.show();
|
||||
viewCounterLabel.show();
|
||||
editor.hide()
|
||||
codeViewPre.show()
|
||||
viewCounterLabel.show()
|
||||
}
|
||||
|
||||
saveButton.click(function () {
|
||||
if (editor.val() === "") {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'err' implicitly has an 'any' type.
|
||||
postPaste(editor.val(), function (err, res) {
|
||||
if (err) {
|
||||
addMessage(err["data"]["message"]);
|
||||
addMessage(err["data"]["message"])
|
||||
} else {
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
|
||||
window.history.pushState(null, null, `/~/${res["data"]["id"]}`);
|
||||
viewPaste(res["data"]["content"], "0");
|
||||
window.history.pushState(null, "", `/~/${res["data"]["id"]}`)
|
||||
viewPaste(res["data"]["content"], "0")
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
copyButton.click(function () {
|
||||
//TODO: Make copy paste to new paste
|
||||
|
@ -177,52 +178,47 @@ copyButton.click(function () {
|
|||
// addMessage("Copied paste to clipboard!")
|
||||
// }
|
||||
// });
|
||||
});
|
||||
})
|
||||
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'e' implicitly has an 'any' type.
|
||||
editor.keydown(function (e) {
|
||||
editor.keydown(function (e: KeyboardEvent) {
|
||||
if (e.key == "Tab") {
|
||||
e.preventDefault();
|
||||
// @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message
|
||||
let start = this.selectionStart;
|
||||
// @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message
|
||||
let end = this.selectionEnd;
|
||||
// @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message
|
||||
this.value = this.value.substring(0, start) + "\t" + this.value.substring(end);
|
||||
// @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message
|
||||
this.selectionStart = this.selectionEnd = start + 1;
|
||||
e.preventDefault()
|
||||
let start: string = this.selectionStart
|
||||
let end: string = this.selectionEnd
|
||||
this.value =
|
||||
this.value.substring(0, start) + "\t" + this.value.substring(end)
|
||||
this.selectionStart = this.selectionEnd = start + 1
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'event' implicitly has an 'any' type.
|
||||
function handlePopstate(event) {
|
||||
const path = window.location.pathname;
|
||||
const path = window.location.pathname
|
||||
|
||||
if (path == "/") {
|
||||
newPaste();
|
||||
newPaste()
|
||||
} else {
|
||||
const split = path.split("/");
|
||||
const split = path.split("/")
|
||||
|
||||
const id = split[split.length - 1];
|
||||
const id = split[split.length - 1]
|
||||
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'err' implicitly has an 'any' type.
|
||||
getPaste(id, function (err, res) {
|
||||
if (err) {
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
|
||||
window.history.pushState(null, null, `/`);
|
||||
newPaste();
|
||||
window.history.pushState(null, "", `/`)
|
||||
newPaste()
|
||||
} else {
|
||||
viewPaste(res["data"]["content"], res["data"]["views"].toString());
|
||||
viewPaste(
|
||||
res["data"]["content"],
|
||||
res["data"]["views"].toString()
|
||||
)
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'event' implicitly has an 'any' type.
|
||||
$(window).bind("popstate", function (event) {
|
||||
handlePopstate(event);
|
||||
});
|
||||
handlePopstate(event)
|
||||
})
|
||||
|
||||
$(document).ready(function () {
|
||||
handlePopstate({ target: window });
|
||||
});
|
||||
handlePopstate({ target: window })
|
||||
})
|
||||
|
|
|
@ -1,101 +1,101 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
||||
"compilerOptions": {
|
||||
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
||||
|
||||
/* Projects */
|
||||
// "incremental": true, /* Enable incremental compilation */
|
||||
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
||||
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
||||
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
|
||||
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
||||
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||
/* Projects */
|
||||
// "incremental": true, /* Enable incremental compilation */
|
||||
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
||||
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
||||
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
|
||||
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
||||
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||
|
||||
/* Language and Environment */
|
||||
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
||||
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
||||
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
||||
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
|
||||
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
||||
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
||||
/* Language and Environment */
|
||||
"target": "es5" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
||||
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
||||
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
||||
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
||||
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
|
||||
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
||||
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
||||
|
||||
/* Modules */
|
||||
"module": "commonjs", /* Specify what module code is generated. */
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
||||
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||
// "resolveJsonModule": true, /* Enable importing .json files */
|
||||
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
||||
/* Modules */
|
||||
"module": "es6" /* Specify what module code is generated. */,
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
||||
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
||||
"allowUmdGlobalAccess": true /* Allow accessing UMD globals from modules. */,
|
||||
"resolveJsonModule": true /* Enable importing .json files */,
|
||||
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
||||
|
||||
/* JavaScript Support */
|
||||
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
|
||||
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
||||
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
||||
/* JavaScript Support */
|
||||
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
|
||||
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
||||
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
||||
|
||||
/* Emit */
|
||||
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
||||
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
||||
// "removeComments": true, /* Disable emitting comments. */
|
||||
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
|
||||
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
||||
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
||||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
||||
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
||||
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
||||
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
||||
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
|
||||
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
||||
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
||||
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
||||
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
||||
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
||||
/* Emit */
|
||||
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
||||
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
||||
// "removeComments": true, /* Disable emitting comments. */
|
||||
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
|
||||
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
||||
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
||||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
||||
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
||||
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
||||
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
||||
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
|
||||
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
||||
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
||||
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
||||
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
||||
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
||||
|
||||
/* Interop Constraints */
|
||||
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
||||
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
|
||||
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
||||
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
||||
/* Interop Constraints */
|
||||
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
||||
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
|
||||
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
||||
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
||||
|
||||
/* Type Checking */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
|
||||
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
||||
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
||||
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
||||
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
||||
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
||||
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
||||
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
||||
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
||||
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
||||
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
||||
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
||||
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
||||
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
||||
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
||||
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
||||
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
||||
/* Type Checking */
|
||||
"strict": true /* Enable all strict type-checking options. */,
|
||||
"noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied `any` type.. */,
|
||||
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
||||
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
||||
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
||||
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
||||
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
||||
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
||||
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
||||
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
||||
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
||||
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
||||
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
||||
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
||||
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
||||
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
||||
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
||||
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
||||
|
||||
/* Completeness */
|
||||
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||
}
|
||||
/* Completeness */
|
||||
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue