add typescript

This commit is contained in:
Jonathan Jenne
2023-08-28 16:42:29 +02:00
parent 76c1d9f380
commit d0d845bfd4
8 changed files with 8725 additions and 23 deletions

View File

@@ -1,24 +1,41 @@
// This function will be called in the ShowEnvelope.razor page
// and will trigger loading of the Editor Interface
function loadPDFFromUrl(container, url) {
console.log("Loading PSPDFKit..");
console.log(PSPDFKit);
fetch(url, { credentials: "include" })
.then(res => res.arrayBuffer())
.then(arrayBuffer => PSPDFKit.load({
container: container,
document: arrayBuffer
}))
.then(instance => {
console.log("PSPDFKit loaded", instance)
configurePSPDFKit(instance);
var App = /** @class */ (function () {
function App() {
}
App.loadPDFFromUrl = function (container, url) {
console.log("Loading PSPDFKit..");
fetch(url, { credentials: "include" })
.then(function (res) { return res.arrayBuffer(); })
.then(function (arrayBuffer) { return App.loadPSPDFKit(arrayBuffer, container); })
.then(function (instance) {
console.log("PSPDFKit loaded!");
console.log(instance);
})
.catch(error => {
.catch(function (error) {
console.error(error.message);
});
}
function configurePSPDFKit(instance) {
console.log(instance);
}
};
App.loadPSPDFKit = function (arrayBuffer, container) {
PSPDFKit.load({
container: container,
document: arrayBuffer
});
};
return App;
}());
export { App };
// This function will be called in the ShowEnvelope.razor page
// and will trigger loading of the Editor Interface
//const loadPDFFromUrl = function (container: string, url: string): void {
// console.log("Loading PSPDFKit..");
// fetch(url, { credentials: "include" })
// .then(res => res.arrayBuffer())
// .then(arrayBuffer => loadPSPDFKit(arrayBuffer, container))
// .then(configurePSPDFKit)
// .then(instance => {
// console.log("PSPDFKit loaded!")
// })
// .catch(error => {
// console.error(error.message);
// });
//}
//# sourceMappingURL=app.js.map