├── storage └── .gitkeep ├── .gitignore ├── src ├── mycss2.css ├── app-core │ └── lib.ts ├── mycss.css ├── app.ts └── index.d.ts ├── neutralinojs.log ├── neutralino.png ├── app ├── settings-browser.json ├── settings-cloud.json ├── settings.json ├── assets │ ├── app.js │ ├── app.css │ └── neutralino.js └── index.html ├── tsconfig.json ├── package.json ├── README.md ├── .github └── FUNDING.yml ├── webpack.config.js └── LICENSE /storage/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .log -------------------------------------------------------------------------------- /src/mycss2.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: black; 3 | } -------------------------------------------------------------------------------- /neutralinojs.log: -------------------------------------------------------------------------------- 1 | ERROR [src/Socket.cpp:Bind] Socket::bind error: Address already in use 2 | -------------------------------------------------------------------------------- /neutralino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutralinojs/neutralinojs-typescript/HEAD/neutralino.png -------------------------------------------------------------------------------- /app/settings-browser.json: -------------------------------------------------------------------------------- 1 | { 2 | "appname" : "myapp", 3 | "appport" : "8080", 4 | "mode" : "browser" 5 | } 6 | -------------------------------------------------------------------------------- /app/settings-cloud.json: -------------------------------------------------------------------------------- 1 | { 2 | "appname" : "myapp", 3 | "appport" : "8080", 4 | "mode" : "cloud", 5 | "cloud" : { 6 | "blacklist" : ["os.runCommand"] 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "./dist/", 4 | "noImplicitAny": true, 5 | "module": "es6", 6 | "target": "es5", 7 | "allowJs": false 8 | } 9 | } -------------------------------------------------------------------------------- /src/app-core/lib.ts: -------------------------------------------------------------------------------- 1 | export class AppLib { 2 | public showSettings(): void { 3 | Neutralino.settings.getSettings((data) => { 4 | alert(JSON.stringify(data)); 5 | }, () => { 6 | 7 | }); 8 | } 9 | } -------------------------------------------------------------------------------- /app/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "appname" : "myapp", 3 | "appport" : "5006", 4 | "mode" : "window", 5 | "iconfile" : "neutralino.png", 6 | "window" : { 7 | "width" : "1000", 8 | "height" : "700", 9 | "fullscreen" : false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "neutralinojs-typescript", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "webpack -p --config webpack.config.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "css-loader": "^3.6.0", 14 | "extract-text-webpack-plugin": "^3.0.2", 15 | "mini-css-extract-plugin": "^0.9.0", 16 | "ts-loader": "^6.2.2", 17 | "typescript": "^3.9.7", 18 | "webpack": "^4.44.1", 19 | "webpack-cli": "^3.3.12" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Notice 🔔 2 | 3 | Please use https://github.com/neutralinojs/neutralinojs-minimal instead of this template, if you are trying Neutralinojs v2. 4 | 5 | # neutralinojs-typescript 6 | 7 | Typescript starter project for Neutralinojs 8 | 9 | ## Get started 10 | 11 | Install [neu-cli](https://neutralino.js.org/docs/#/tools/cli) 12 | 13 | ```bash 14 | $ npm i -g @neutralinojs/neu 15 | ``` 16 | 17 | Create Neutralino app with Typescript template 18 | 19 | ```bash 20 | $ neu create myapp --template ts 21 | $ cd myapp 22 | ``` 23 | 24 | Bundle source files 25 | 26 | ```bash 27 | $ neu build 28 | ``` 29 | 30 | Learn more about neu-cli from [docs](https://neutralino.js.org/docs/#/tools/cli) 31 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: shalithasuranga 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 3 | 4 | module.exports = { 5 | entry: path.resolve(__dirname, './src/app.ts'), 6 | module: { 7 | rules: [ 8 | { 9 | test: /\.ts?$/, 10 | use: 'ts-loader', 11 | exclude: /node_modules/, 12 | }, 13 | { 14 | test: /\.css$/i, 15 | use: [ 16 | { 17 | loader: MiniCssExtractPlugin.loader, 18 | }, 19 | 'css-loader', 20 | ], 21 | }, 22 | 23 | ], 24 | }, 25 | resolve: { 26 | extensions: ['.ts'], 27 | }, 28 | output: { 29 | filename: 'app.js', 30 | path: path.resolve(__dirname, './app/assets'), 31 | }, 32 | plugins: [ 33 | new MiniCssExtractPlugin({ 34 | filename: 'app.css' 35 | }), 36 | ], 37 | }; -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Neutralinojs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /app/assets/app.js: -------------------------------------------------------------------------------- 1 | !function(n){var t={};function e(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}e.m=n,e.c=t,e.d=function(n,t,r){e.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:r})},e.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,t){if(1&t&&(n=e(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var o in n)e.d(r,o,function(t){return n[t]}.bind(null,o));return r},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},e.p="",e(e.s=2)}([function(n,t,e){},function(n,t,e){},function(n,t,e){"use strict";e.r(t);var r=function(){function n(){}return n.prototype.showSettings=function(){Neutralino.settings.getSettings((function(n){alert(JSON.stringify(n))}),(function(){}))},n}(),o=(e(0),e(1),new r),i=function(){document.getElementById("info").innerHTML=NL_NAME+" is running on port "+NL_PORT+" inside "+NL_OS+"

v"+NL_VERSION+""};Neutralino.init({load:function(){i(),o.showSettings()},pingSuccessCallback:function(){},pingFailCallback:function(){}})}]); -------------------------------------------------------------------------------- /src/mycss.css: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018 Neutralinojs 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. */ 23 | 24 | #neutralinoapp { 25 | text-align: center; 26 | color: white; 27 | } 28 | #neutralinoapp h1{ 29 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 30 | font-size: 20px; 31 | color: #000000; 32 | } 33 | #neutralinoapp a { 34 | margin-left: 12px; 35 | } 36 | #neutralinoapp span { 37 | font-size: 12px; 38 | font-weight: normal; 39 | } -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | 26 | 27 | 28 | 29 | NeutralinoJs 30 | 31 | 32 | 33 |
34 |

..

35 |
36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/assets/app.css: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018 Neutralinojs 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. */ 23 | 24 | #neutralinoapp { 25 | text-align: center; 26 | color: white; 27 | } 28 | #neutralinoapp h1{ 29 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 30 | font-size: 20px; 31 | color: #000000; 32 | } 33 | #neutralinoapp a { 34 | margin-left: 12px; 35 | } 36 | #neutralinoapp span { 37 | font-size: 12px; 38 | font-weight: normal; 39 | } 40 | body { 41 | background-color: black; 42 | } 43 | -------------------------------------------------------------------------------- /src/app.ts: -------------------------------------------------------------------------------- 1 | // MIT License 2 | 3 | // Copyright (c) 2018 Neutralinojs 4 | 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | import {AppLib} from './app-core/lib'; 24 | import './mycss.css'; 25 | import './mycss2.css'; 26 | 27 | let appLib = new AppLib(); 28 | 29 | let myapp: any = { 30 | myfunction : function () { document.getElementById('info').innerHTML = NL_NAME + " is running on port " + 31 | NL_PORT + " inside " + NL_OS + "

" + "v" + NL_VERSION + ""; } 32 | }; 33 | 34 | 35 | Neutralino.init({ 36 | load: function() { 37 | myapp.myfunction(); 38 | appLib.showSettings(); 39 | }, 40 | pingSuccessCallback : function() { 41 | 42 | }, 43 | pingFailCallback : function() { 44 | 45 | } 46 | }); -------------------------------------------------------------------------------- /src/index.d.ts: -------------------------------------------------------------------------------- 1 | declare var NL_VERSION: string; 2 | declare var NL_NAME: string; 3 | declare var NL_OS: string; 4 | declare var NL_PORT: string; 5 | declare var NL_MODE: string; 6 | declare var NL_CWD: string; 7 | 8 | declare namespace Neutralino { 9 | 10 | interface DirectoryData { 11 | files: [ 12 | { 13 | name: string; 14 | type: 'directory' | 'file'; 15 | } 16 | ] 17 | } 18 | 19 | interface SuccessData { 20 | success: 'true'; 21 | } 22 | 23 | interface StdoutData { 24 | stdout: string; 25 | } 26 | 27 | interface ValueData { 28 | value: string; 29 | } 30 | 31 | interface FileData { 32 | file: string; 33 | } 34 | 35 | interface RamData { 36 | ram: { 37 | available: number; 38 | total: number; 39 | } 40 | } 41 | 42 | interface StoragePutData { 43 | key: string; 44 | content: any; 45 | } 46 | 47 | interface LogSuccessData { 48 | message: string; 49 | } 50 | 51 | type AppMode = 52 | 'window' | 'browser' | 'cloud'; 53 | 54 | interface SettingsData { 55 | appname: string; 56 | appport?: string; 57 | mode?: string; 58 | cloud?: { 59 | blacklist?: string[] 60 | }; 61 | globals?: { 62 | [key: string]: string; 63 | }; 64 | window?: { 65 | title?: string; 66 | width?: string; 67 | height?: string; 68 | fullscreen?: boolean; 69 | alwaysontop?: boolean; 70 | iconfile?: string; 71 | enableinspector?: boolean; 72 | borderlesswindow?: boolean; 73 | }; 74 | } 75 | 76 | interface InitOptions { 77 | load: () => void; 78 | pingSuccessCallback: () => void; 79 | pingFailCallback: () => void; 80 | } 81 | 82 | type LogType = 83 | 'INFO' | 'ERROR' | 'WARN'; 84 | 85 | function init(options: InitOptions): void; 86 | 87 | namespace settings { 88 | function getSettings(success: (data : SettingsData) => void, fail: () => void): void; 89 | } 90 | 91 | namespace os { 92 | function runCommand(command: string, success: (data: StdoutData) => void, fail: () => void): void; 93 | function getEnvar(key: string, success: (data : ValueData) => void, fail: () => void): void; 94 | function dialogOpen(title: string, success: (data : FileData) => void, fail: () => void): void; 95 | function dialogSave(title: string, success: (data : FileData) => void, fail: () => void): void; 96 | } 97 | 98 | namespace filesystem { 99 | function createDirectory(dirName: string, success: (data : any) => void, fail: () => void): void; 100 | function removeDirectory(dirName: string, success: (data : any) => void, fail: () => void): void; 101 | function readDirectory(dirName: string, success: (data : DirectoryData) => void, fail: () => void): void; 102 | function writeFile(filename: string, content: string, success: (data: SuccessData) => void, fail: () => void): void; 103 | function readFile(filename: string, success: (data : any) => void, fail: () => void): void; 104 | function removeFile(filename: string, success: (data : SuccessData) => void, fail: () => void): void; 105 | } 106 | 107 | namespace computer { 108 | function getRamUsage(success: (data : RamData) => void, fail: () => void): void; 109 | } 110 | 111 | namespace storage { 112 | function putData(data: StoragePutData, success: () => void, fail: () => void): void; 113 | function getData(key: string, success: (data : any) => void, fail: () => void): void; 114 | } 115 | 116 | namespace debug { 117 | function log(logType: LogType, message: string, success: (data : LogSuccessData) => void, fail: () => void): void; 118 | } 119 | 120 | namespace app { 121 | function exit(success: (data : any) => void, fail: () => void): void; 122 | } 123 | 124 | } -------------------------------------------------------------------------------- /app/assets/neutralino.js: -------------------------------------------------------------------------------- 1 | var Neutralino=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){let o=n(3);e.exports={ajax:function(e){e.method||(e.method=!0);var t=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");t.onreadystatechange=function(){4==t.readyState&&200==t.status?e.done&&e.done(JSON.parse(t.responseText)):4==t.readyState&&e.problem&&e.problem({message:"An error occured while connecting with Neutralino server!"})},void 0!==e.data&&(sendString=JSON.stringify(e.data)),"GET"==e.type&&(t.open("GET",e.url,e.method),t.setRequestHeader("Authorization","Basic "+o.getToken()),t.send()),"POST"==e.type&&(t.open("POST",e.url,e.method),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.setRequestHeader("Authorization","Basic "+o.getToken()),t.send(sendString))}}},function(e,t,n){let o=n(2),r=n(4),a=n(5),i=n(6),u=n(7),c=n(8),l=n(11),f=n(12);e.exports={app:f,filesystem:o,settings:r,os:a,computer:i,storage:u,init:c,debug:l}},function(e,t,n){let o=n(0);e.exports={createDirectory:function(e,t,n){o.ajax({url:"/filesystem/createDirectory",type:"POST",data:{dir:e},done:function(e){t(e)},problem:function(e){n(e)}})},removeDirectory:function(e,t,n){o.ajax({url:"/filesystem/removeDirectory",type:"POST",data:{dir:e},done:function(e){t(e)},problem:function(e){n(e)}})},writeFile:function(e,t,n,r){o.ajax({url:"/filesystem/writeFile",type:"POST",data:{filename:e,content:t},done:function(e){n(e)},problem:function(e){r(e)}})},readFile:function(e,t,n){o.ajax({url:"/filesystem/readFile",type:"POST",data:{filename:e},done:function(e){t(e)},problem:function(e){n(e)}})},removeFile:function(e,t,n){o.ajax({url:"/filesystem/removeFile",type:"POST",data:{filename:e},done:function(e){t(e)},problem:function(e){n(e)}})},readDirectory:function(e,t,n){o.ajax({url:"/filesystem/readDirectory",type:"POST",data:{path:e},done:function(e){t(e)},problem:function(e){n(e)}})}}},function(e,t){e.exports={getToken:function(){return NL_TOKEN}}},function(e,t,n){let o=n(0);e.exports={getSettings:function(e,t){o.ajax({url:"/settings.json",type:"GET",done:function(t){e(t)},problem:function(e){t(e)}})}}},function(e,t,n){let o=n(0);e.exports={runCommand:function(e,t,n){o.ajax({url:"/os/runCommand",type:"POST",data:{command:e},done:function(e){t(e)},problem:function(e){n(e)}})},getEnvar:function(e,t,n){o.ajax({url:"/os/getEnvar",type:"POST",data:{name:e},done:function(e){t(e)},problem:function(e){n(e)}})},dialogOpen:function(e,t,n){o.ajax({url:"/os/dialogOpen",type:"POST",data:{title:e.title,isDirectoryMode:e.isDirectoryMode},done:function(e){t(e)},problem:function(e){n(e)}})},dialogSave:function(e,t,n){o.ajax({url:"/os/dialogSave",type:"POST",data:{title:e},done:function(e){t(e)},problem:function(e){n(e)}})},showNotification:function(e,t,n){o.ajax({url:"/os/showNotification",type:"POST",data:{summary:e.summary,body:e.body},done:function(e){t(e)},problem:function(e){n(e)}})}}},function(e,t,n){let o=n(0);e.exports={getRamUsage:function(e,t){o.ajax({url:"/computer/getRamUsage",type:"GET",done:function(t){e(t)},problem:function(e){t(e)}})}}},function(e,t,n){let o=n(0);e.exports={putData:function(e,t,n){o.ajax({url:"/storage/putData",type:"POST",data:{bucket:e.bucket,content:e.content},done:function(e){t(e)},problem:function(e){n(e)}})},getData:function(e,t,n){o.ajax({url:"/storage/getData",type:"POST",data:{bucket:e},done:function(e){t(JSON.parse(e.content))},problem:function(e){n(e)}})}}},function(e,t,n){let o=n(9),r=n(10);e.exports=function(e){let t=null,n=null;e.load&&e.load(),e.pingSuccessCallback&&(t=e.pingSuccessCallback),e.pingFailCallback&&(n=e.pingFailCallback),"browser"==NL_MODE&&o.start(t,n);for(let e=0;e