add typescript
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user