@wails/runtime@v3.0.0-alpha.14

This commit is contained in:
Lea Anthony 2024-01-08 21:21:24 +11:00
commit df0419a7d6
No known key found for this signature in database
GPG key ID: 33DAF7BB90A58405
19 changed files with 1341 additions and 678 deletions

View file

@ -1,16 +1,17 @@
{
"name": "@wailsio/runtime",
"version": "3.0.0-alpha.7",
"version": "3.0.0-alpha.14",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@wailsio/runtime",
"version": "3.0.0-alpha.7",
"version": "3.0.0-alpha.14",
"license": "MIT",
"devDependencies": {
"@microsoft/api-extractor": "^7.39.0",
"rimraf": "^5.0.5",
"typedoc": "^0.25.7",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "^5.3.3"
}
},
@ -31,71 +32,6 @@
"node": ">=12"
}
},
"node_modules/@microsoft/api-extractor": {
"version": "7.39.0",
"resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.39.0.tgz",
"integrity": "sha512-PuXxzadgnvp+wdeZFPonssRAj/EW4Gm4s75TXzPk09h3wJ8RS3x7typf95B4vwZRrPTQBGopdUl+/vHvlPdAcg==",
"dev": true,
"dependencies": {
"@microsoft/api-extractor-model": "7.28.3",
"@microsoft/tsdoc": "0.14.2",
"@microsoft/tsdoc-config": "~0.16.1",
"@rushstack/node-core-library": "3.62.0",
"@rushstack/rig-package": "0.5.1",
"@rushstack/ts-command-line": "4.17.1",
"colors": "~1.2.1",
"lodash": "~4.17.15",
"resolve": "~1.22.1",
"semver": "~7.5.4",
"source-map": "~0.6.1",
"typescript": "5.3.3"
},
"bin": {
"api-extractor": "bin/api-extractor"
}
},
"node_modules/@microsoft/api-extractor-model": {
"version": "7.28.3",
"resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.28.3.tgz",
"integrity": "sha512-wT/kB2oDbdZXITyDh2SQLzaWwTOFbV326fP0pUwNW00WeliARs0qjmXBWmGWardEzp2U3/axkO3Lboqun6vrig==",
"dev": true,
"dependencies": {
"@microsoft/tsdoc": "0.14.2",
"@microsoft/tsdoc-config": "~0.16.1",
"@rushstack/node-core-library": "3.62.0"
}
},
"node_modules/@microsoft/tsdoc": {
"version": "0.14.2",
"resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz",
"integrity": "sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==",
"dev": true
},
"node_modules/@microsoft/tsdoc-config": {
"version": "0.16.2",
"resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.16.2.tgz",
"integrity": "sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==",
"dev": true,
"dependencies": {
"@microsoft/tsdoc": "0.14.2",
"ajv": "~6.12.6",
"jju": "~1.4.0",
"resolve": "~1.19.0"
}
},
"node_modules/@microsoft/tsdoc-config/node_modules/resolve": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
"integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
"dev": true,
"dependencies": {
"is-core-module": "^2.1.0",
"path-parse": "^1.0.6"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/@pkgjs/parseargs": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
@ -106,73 +42,6 @@
"node": ">=14"
}
},
"node_modules/@rushstack/node-core-library": {
"version": "3.62.0",
"resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.62.0.tgz",
"integrity": "sha512-88aJn2h8UpSvdwuDXBv1/v1heM6GnBf3RjEy6ZPP7UnzHNCqOHA2Ut+ScYUbXcqIdfew9JlTAe3g+cnX9xQ/Aw==",
"dev": true,
"dependencies": {
"colors": "~1.2.1",
"fs-extra": "~7.0.1",
"import-lazy": "~4.0.0",
"jju": "~1.4.0",
"resolve": "~1.22.1",
"semver": "~7.5.4",
"z-schema": "~5.0.2"
},
"peerDependencies": {
"@types/node": "*"
},
"peerDependenciesMeta": {
"@types/node": {
"optional": true
}
}
},
"node_modules/@rushstack/rig-package": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.1.tgz",
"integrity": "sha512-pXRYSe29TjRw7rqxD4WS3HN/sRSbfr+tJs4a9uuaSIBAITbUggygdhuG0VrO0EO+QqH91GhYMN4S6KRtOEmGVA==",
"dev": true,
"dependencies": {
"resolve": "~1.22.1",
"strip-json-comments": "~3.1.1"
}
},
"node_modules/@rushstack/ts-command-line": {
"version": "4.17.1",
"resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.17.1.tgz",
"integrity": "sha512-2jweO1O57BYP5qdBGl6apJLB+aRIn5ccIRTPDyULh0KMwVzFqWtw6IZWt1qtUoZD/pD2RNkIOosH6Cq45rIYeg==",
"dev": true,
"dependencies": {
"@types/argparse": "1.0.38",
"argparse": "~1.0.9",
"colors": "~1.2.1",
"string-argv": "~0.3.1"
}
},
"node_modules/@types/argparse": {
"version": "1.0.38",
"resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz",
"integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==",
"dev": true
},
"node_modules/ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"dev": true,
"dependencies": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/epoberezkin"
}
},
"node_modules/ansi-regex": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
@ -185,6 +54,12 @@
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
"node_modules/ansi-sequence-parser": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz",
"integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==",
"dev": true
},
"node_modules/ansi-styles": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
@ -197,15 +72,6 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"dependencies": {
"sprintf-js": "~1.0.2"
}
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@ -239,25 +105,6 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"node_modules/colors": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz",
"integrity": "sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==",
"dev": true,
"engines": {
"node": ">=0.1.90"
}
},
"node_modules/commander": {
"version": "9.5.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
"dev": true,
"optional": true,
"engines": {
"node": "^12.20.0 || >=14"
}
},
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
@ -284,18 +131,6 @@
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
"dev": true
},
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true
},
"node_modules/fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
"dev": true
},
"node_modules/foreground-child": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz",
@ -312,29 +147,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/fs-extra": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
"integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.1.2",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
},
"engines": {
"node": ">=6 <7 || >=8"
}
},
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
"dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/glob": {
"version": "10.3.10",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz",
@ -357,43 +169,25 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/graceful-fs": {
"version": "4.2.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
"dev": true
},
"node_modules/hasown": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz",
"integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==",
"node_modules/handlebars": {
"version": "4.7.8",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
"integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
"dev": true,
"dependencies": {
"function-bind": "^1.1.2"
"minimist": "^1.2.5",
"neo-async": "^2.6.2",
"source-map": "^0.6.1",
"wordwrap": "^1.0.0"
},
"bin": {
"handlebars": "bin/handlebars"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/import-lazy": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz",
"integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/is-core-module": {
"version": "2.13.1",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz",
"integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==",
"dev": true,
"dependencies": {
"hasown": "^2.0.0"
"node": ">=0.4.7"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
"optionalDependencies": {
"uglify-js": "^3.1.4"
}
},
"node_modules/is-fullwidth-code-point": {
@ -429,55 +223,28 @@
"@pkgjs/parseargs": "^0.11.0"
}
},
"node_modules/jju": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz",
"integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==",
"node_modules/jsonc-parser": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
"dev": true
},
"node_modules/json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"node_modules/lunr": {
"version": "2.3.9",
"resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
"integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==",
"dev": true
},
"node_modules/jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==",
"node_modules/marked": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz",
"integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==",
"dev": true,
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"node_modules/lodash.get": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
"integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==",
"dev": true
},
"node_modules/lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==",
"dev": true
},
"node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"dependencies": {
"yallist": "^4.0.0"
"bin": {
"marked": "bin/marked.js"
},
"engines": {
"node": ">=10"
"node": ">= 12"
}
},
"node_modules/minimatch": {
@ -495,6 +262,15 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/minipass": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz",
@ -504,6 +280,12 @@
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/neo-async": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
"dev": true
},
"node_modules/path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
@ -513,12 +295,6 @@
"node": ">=8"
}
},
"node_modules/path-parse": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true
},
"node_modules/path-scurry": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz",
@ -544,32 +320,6 @@
"node": "14 || >=16.14"
}
},
"node_modules/punycode": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"dev": true,
"engines": {
"node": ">=6"
}
},
"node_modules/resolve": {
"version": "1.22.8",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz",
"integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==",
"dev": true,
"dependencies": {
"is-core-module": "^2.13.0",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
},
"bin": {
"resolve": "bin/resolve"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/rimraf": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz",
@ -588,21 +338,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
@ -624,6 +359,18 @@
"node": ">=8"
}
},
"node_modules/shiki": {
"version": "0.14.7",
"resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz",
"integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==",
"dev": true,
"dependencies": {
"ansi-sequence-parser": "^1.1.0",
"jsonc-parser": "^3.2.0",
"vscode-oniguruma": "^1.7.0",
"vscode-textmate": "^8.0.0"
}
},
"node_modules/signal-exit": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
@ -645,21 +392,6 @@
"node": ">=0.10.0"
}
},
"node_modules/sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
"dev": true
},
"node_modules/string-argv": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz",
"integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==",
"dev": true,
"engines": {
"node": ">=0.6.19"
}
},
"node_modules/string-width": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
@ -756,28 +488,37 @@
"node": ">=8"
}
},
"node_modules/strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"node_modules/typedoc": {
"version": "0.25.7",
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.7.tgz",
"integrity": "sha512-m6A6JjQRg39p2ZVRIN3NKXgrN8vzlHhOS+r9ymUYtcUP/TIQPvWSq7YgE5ZjASfv5Vd5BW5xrir6Gm2XNNcOow==",
"dev": true,
"engines": {
"node": ">=8"
"dependencies": {
"lunr": "^2.3.9",
"marked": "^4.3.0",
"minimatch": "^9.0.3",
"shiki": "^0.14.7"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
"bin": {
"typedoc": "bin/typedoc"
},
"engines": {
"node": ">= 16"
},
"peerDependencies": {
"typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x"
}
},
"node_modules/supports-preserve-symlinks-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
"node_modules/typedoc-plugin-markdown": {
"version": "3.17.1",
"resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.1.tgz",
"integrity": "sha512-QzdU3fj0Kzw2XSdoL15ExLASt2WPqD7FbLeaqwT70+XjKyTshBnUlQA5nNREO1C2P8Uen0CDjsBLMsCQ+zd0lw==",
"dev": true,
"engines": {
"node": ">= 0.4"
"dependencies": {
"handlebars": "^4.7.7"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
"peerDependencies": {
"typedoc": ">=0.24.0"
}
},
"node_modules/typescript": {
@ -793,32 +534,30 @@
"node": ">=14.17"
}
},
"node_modules/universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"node_modules/uglify-js": {
"version": "3.17.4",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
"integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
"dev": true,
"optional": true,
"bin": {
"uglifyjs": "bin/uglifyjs"
},
"engines": {
"node": ">= 4.0.0"
"node": ">=0.8.0"
}
},
"node_modules/uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
"integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
"dev": true,
"dependencies": {
"punycode": "^2.1.0"
}
"node_modules/vscode-oniguruma": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz",
"integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==",
"dev": true
},
"node_modules/validator": {
"version": "13.11.0",
"resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz",
"integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==",
"dev": true,
"engines": {
"node": ">= 0.10"
}
"node_modules/vscode-textmate": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz",
"integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==",
"dev": true
},
"node_modules/which": {
"version": "2.0.2",
@ -835,6 +574,12 @@
"node": ">= 8"
}
},
"node_modules/wordwrap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
"dev": true
},
"node_modules/wrap-ansi": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
@ -925,32 +670,6 @@
"engines": {
"node": ">=8"
}
},
"node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
},
"node_modules/z-schema": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/z-schema/-/z-schema-5.0.5.tgz",
"integrity": "sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==",
"dev": true,
"dependencies": {
"lodash.get": "^4.4.2",
"lodash.isequal": "^4.5.0",
"validator": "^13.7.0"
},
"bin": {
"z-schema": "bin/z-schema"
},
"engines": {
"node": ">=8.0.0"
},
"optionalDependencies": {
"commander": "^9.4.1"
}
}
}
}

View file

@ -1,6 +1,6 @@
{
"name": "@wailsio/runtime",
"version": "3.0.0-alpha.13",
"version": "3.0.0-alpha.14",
"description": "Wails Runtime",
"main": "src/index.js",
"types": "types/index.d.ts",
@ -10,7 +10,10 @@
},
"scripts": {
"prebuild:types": "rimraf ./types",
"build:types": "npx -p typescript tsc src/index.js --declaration --allowJs --emitDeclarationOnly --outDir types"
"build:types": "npx -p typescript tsc src/index.js --declaration --allowJs --emitDeclarationOnly --outDir types",
"postbuild:types": "wails3 task generate:events",
"build:docs": "npx typedoc ./src/index.js",
"build:docs:md": "npx typedoc --plugin typedoc-plugin-markdown --namedAnchors true --hideBreadcrumbs true --out ../../../../../../mkdocs-website/docs/en/api/js ./src/index.js"
},
"author": "The Wails Team",
"license": "MIT",
@ -21,6 +24,8 @@
"private": false,
"devDependencies": {
"rimraf": "^5.0.5",
"typedoc": "^0.25.7",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "^5.3.3"
}
}

View file

@ -20,6 +20,11 @@ window._wails = window._wails || {};
window._wails.callResultHandler = resultHandler;
window._wails.callErrorHandler = errorHandler;
/**
* Generates a unique ID using the nanoid library.
*
* @return {string} - A unique ID that does not exist in the callResponses set.
*/
function generateID() {
let result;
do {
@ -28,26 +33,57 @@ function generateID() {
return result;
}
export function resultHandler(id, data, isJSON) {
/**
* Handles the result of a call request.
*
* @param {string} id - The id of the request to handle the result for.
* @param {string} data - The result data of the request.
* @param {boolean} isJSON - Indicates whether the data is JSON or not.
*
* @return {undefined} - This method does not return any value.
*/
function resultHandler(id, data, isJSON) {
const promiseHandler = getAndDeleteResponse(id);
if (promiseHandler) {
promiseHandler.resolve(isJSON ? JSON.parse(data) : data);
}
}
export function errorHandler(id, message) {
/**
* Handles the error from a call request.
*
* @param {string} id - The id of the promise handler.
* @param {string} message - The error message to reject the promise handler with.
*
* @return {void}
*/
function errorHandler(id, message) {
const promiseHandler = getAndDeleteResponse(id);
if (promiseHandler) {
promiseHandler.reject(message);
}
}
/**
* Retrieves and removes the response associated with the given ID from the callResponses map.
*
* @param {any} id - The ID of the response to be retrieved and removed.
*
* @returns {any} The response object associated with the given ID.
*/
function getAndDeleteResponse(id) {
const response = callResponses.get(id);
callResponses.delete(id);
return response;
}
/**
* Executes a call using the provided type and options.
*
* @param {string|number} type - The type of call to execute.
* @param {Object} [options={}] - Additional options for the call.
* @return {Promise} - A promise that will be resolved or rejected based on the result of the call.
*/
function callBinding(type, options = {}) {
return new Promise((resolve, reject) => {
const id = generateID();

View file

@ -11,9 +11,66 @@ The electron alternative for Go
/* jshint esversion: 9 */
/**
* @typedef {import("./types").MessageDialogOptions} MessageDialogOptions
* @typedef {import("./types").OpenDialogOptions} OpenDialogOptions
* @typedef {import("./types").SaveDialogOptions} SaveDialogOptions
* @typedef {Object} OpenFileDialogOptions
* @property {boolean} [CanChooseDirectories] - Indicates if directories can be chosen.
* @property {boolean} [CanChooseFiles] - Indicates if files can be chosen.
* @property {boolean} [CanCreateDirectories] - Indicates if directories can be created.
* @property {boolean} [ShowHiddenFiles] - Indicates if hidden files should be shown.
* @property {boolean} [ResolvesAliases] - Indicates if aliases should be resolved.
* @property {boolean} [AllowsMultipleSelection] - Indicates if multiple selection is allowed.
* @property {boolean} [HideExtension] - Indicates if the extension should be hidden.
* @property {boolean} [CanSelectHiddenExtension] - Indicates if hidden extensions can be selected.
* @property {boolean} [TreatsFilePackagesAsDirectories] - Indicates if file packages should be treated as directories.
* @property {boolean} [AllowsOtherFiletypes] - Indicates if other file types are allowed.
* @property {FileFilter[]} [Filters] - Array of file filters.
* @property {string} [Title] - Title of the dialog.
* @property {string} [Message] - Message to show in the dialog.
* @property {string} [ButtonText] - Text to display on the button.
* @property {string} [Directory] - Directory to open in the dialog.
* @property {boolean} [Detached] - Indicates if the dialog should appear detached from the main window.
*/
/**
* @typedef {Object} SaveFileDialogOptions
* @property {string} [Filename] - Default filename to use in the dialog.
* @property {boolean} [CanChooseDirectories] - Indicates if directories can be chosen.
* @property {boolean} [CanChooseFiles] - Indicates if files can be chosen.
* @property {boolean} [CanCreateDirectories] - Indicates if directories can be created.
* @property {boolean} [ShowHiddenFiles] - Indicates if hidden files should be shown.
* @property {boolean} [ResolvesAliases] - Indicates if aliases should be resolved.
* @property {boolean} [AllowsMultipleSelection] - Indicates if multiple selection is allowed.
* @property {boolean} [HideExtension] - Indicates if the extension should be hidden.
* @property {boolean} [CanSelectHiddenExtension] - Indicates if hidden extensions can be selected.
* @property {boolean} [TreatsFilePackagesAsDirectories] - Indicates if file packages should be treated as directories.
* @property {boolean} [AllowsOtherFiletypes] - Indicates if other file types are allowed.
* @property {FileFilter[]} [Filters] - Array of file filters.
* @property {string} [Title] - Title of the dialog.
* @property {string} [Message] - Message to show in the dialog.
* @property {string} [ButtonText] - Text to display on the button.
* @property {string} [Directory] - Directory to open in the dialog.
* @property {boolean} [Detached] - Indicates if the dialog should appear detached from the main window.
*/
/**
* @typedef {Object} MessageDialogOptions
* @property {string} [Title] - The title of the dialog window.
* @property {string} [Message] - The main message to show in the dialog.
* @property {Button[]} [Buttons] - Array of button options to show in the dialog.
* @property {boolean} [Detached] - True if the dialog should appear detached from the main window (if applicable).
*/
/**
* @typedef {Object} Button
* @property {string} [Label] - Text that appears within the button.
* @property {boolean} [IsCancel] - True if the button should cancel an operation when clicked.
* @property {boolean} [IsDefault] - True if the button should be the default action when the user presses enter.
*/
/**
* @typedef {Object} FileFilter
* @property {string} [DisplayName] - Display name for the filter, it could be "Text Files", "Images" etc.
* @property {string} [Pattern] - Pattern to match for the filter, e.g. "*.txt;*.md" for text markdown files.
*/
import {newRuntimeCallerWithID, objectNames} from "./runtime";
@ -46,7 +103,7 @@ function generateID() {
/**
* Shows a dialog of specified type with the given options.
* @param {number} type - type of dialog
* @param {object} options - options for the dialog
* @param {MessageDialogOptions|OpenFileDialogOptions|SaveFileDialogOptions} options - options for the dialog
* @returns {Promise} promise that resolves with result of dialog
*/
function dialog(type, options = {}) {
@ -61,6 +118,10 @@ function dialog(type, options = {}) {
});
}
window._wails = window._wails || {};
window._wails.dialogErrorCallback = dialogErrorCallback;
window._wails.dialogResultCallback = dialogResultCallback;
/**
* Handles the callback from a dialog.
*
@ -70,7 +131,7 @@ function dialog(type, options = {}) {
*
* @return {undefined}
*/
export function dialogResultCallback(id, data, isJSON) {
function dialogResultCallback(id, data, isJSON) {
let p = dialogResponses.get(id);
if (p) {
if (isJSON) {
@ -90,7 +151,7 @@ export function dialogResultCallback(id, data, isJSON) {
*
* @return {void}
*/
export function dialogErrorCallback(id, message) {
function dialogErrorCallback(id, message) {
let p = dialogResponses.get(id);
if (p) {
p.reject(message);
@ -126,13 +187,13 @@ export const Error = (options) => dialog(DialogError, options);
export const Question = (options) => dialog(DialogQuestion, options);
/**
* @param {OpenDialogOptions} options - Dialog options
* @param {OpenFileDialogOptions} options - Dialog options
* @returns {Promise<string[]|string>} Returns selected file or list of files. Returns blank string if no file is selected.
*/
export const OpenFile = (options) => dialog(DialogOpenFile, options);
/**
* @param {SaveDialogOptions} options - Dialog options
* @param {SaveFileDialogOptions} options - Dialog options
* @returns {Promise<string>} Returns the selected file. Returns blank string if no file is selected.
*/
export const SaveFile = (options) => dialog(DialogSaveFile, options);

View file

@ -0,0 +1,183 @@
export const EventTypes = {
Windows: {
SystemThemeChanged: "windows:SystemThemeChanged",
APMPowerStatusChange: "windows:APMPowerStatusChange",
APMSuspend: "windows:APMSuspend",
APMResumeAutomatic: "windows:APMResumeAutomatic",
APMResumeSuspend: "windows:APMResumeSuspend",
APMPowerSettingChange: "windows:APMPowerSettingChange",
ApplicationStarted: "windows:ApplicationStarted",
WebViewNavigationCompleted: "windows:WebViewNavigationCompleted",
WindowInactive: "windows:WindowInactive",
WindowActive: "windows:WindowActive",
WindowClickActive: "windows:WindowClickActive",
WindowMaximise: "windows:WindowMaximise",
WindowUnMaximise: "windows:WindowUnMaximise",
WindowFullscreen: "windows:WindowFullscreen",
WindowUnFullscreen: "windows:WindowUnFullscreen",
WindowRestore: "windows:WindowRestore",
WindowMinimise: "windows:WindowMinimise",
WindowUnMinimise: "windows:WindowUnMinimise",
WindowClose: "windows:WindowClose",
WindowSetFocus: "windows:WindowSetFocus",
WindowKillFocus: "windows:WindowKillFocus",
WindowDragDrop: "windows:WindowDragDrop",
WindowDragEnter: "windows:WindowDragEnter",
WindowDragLeave: "windows:WindowDragLeave",
WindowDragOver: "windows:WindowDragOver",
},
Mac: {
ApplicationDidBecomeActive: "mac:ApplicationDidBecomeActive",
ApplicationDidChangeBackingProperties: "mac:ApplicationDidChangeBackingProperties",
ApplicationDidChangeEffectiveAppearance: "mac:ApplicationDidChangeEffectiveAppearance",
ApplicationDidChangeIcon: "mac:ApplicationDidChangeIcon",
ApplicationDidChangeOcclusionState: "mac:ApplicationDidChangeOcclusionState",
ApplicationDidChangeScreenParameters: "mac:ApplicationDidChangeScreenParameters",
ApplicationDidChangeStatusBarFrame: "mac:ApplicationDidChangeStatusBarFrame",
ApplicationDidChangeStatusBarOrientation: "mac:ApplicationDidChangeStatusBarOrientation",
ApplicationDidFinishLaunching: "mac:ApplicationDidFinishLaunching",
ApplicationDidHide: "mac:ApplicationDidHide",
ApplicationDidResignActiveNotification: "mac:ApplicationDidResignActiveNotification",
ApplicationDidUnhide: "mac:ApplicationDidUnhide",
ApplicationDidUpdate: "mac:ApplicationDidUpdate",
ApplicationWillBecomeActive: "mac:ApplicationWillBecomeActive",
ApplicationWillFinishLaunching: "mac:ApplicationWillFinishLaunching",
ApplicationWillHide: "mac:ApplicationWillHide",
ApplicationWillResignActive: "mac:ApplicationWillResignActive",
ApplicationWillTerminate: "mac:ApplicationWillTerminate",
ApplicationWillUnhide: "mac:ApplicationWillUnhide",
ApplicationWillUpdate: "mac:ApplicationWillUpdate",
ApplicationTerminate: "mac:ApplicationTerminate",
ApplicationDidChangeTheme: "mac:ApplicationDidChangeTheme!",
ApplicationShouldHandleReopen: "mac:ApplicationShouldHandleReopen!",
WindowDidBecomeKey: "mac:WindowDidBecomeKey",
WindowDidBecomeMain: "mac:WindowDidBecomeMain",
WindowDidBeginSheet: "mac:WindowDidBeginSheet",
WindowDidChangeAlpha: "mac:WindowDidChangeAlpha",
WindowDidChangeBackingLocation: "mac:WindowDidChangeBackingLocation",
WindowDidChangeBackingProperties: "mac:WindowDidChangeBackingProperties",
WindowDidChangeCollectionBehavior: "mac:WindowDidChangeCollectionBehavior",
WindowDidChangeEffectiveAppearance: "mac:WindowDidChangeEffectiveAppearance",
WindowDidChangeOcclusionState: "mac:WindowDidChangeOcclusionState",
WindowDidChangeOrderingMode: "mac:WindowDidChangeOrderingMode",
WindowDidChangeScreen: "mac:WindowDidChangeScreen",
WindowDidChangeScreenParameters: "mac:WindowDidChangeScreenParameters",
WindowDidChangeScreenProfile: "mac:WindowDidChangeScreenProfile",
WindowDidChangeScreenSpace: "mac:WindowDidChangeScreenSpace",
WindowDidChangeScreenSpaceProperties: "mac:WindowDidChangeScreenSpaceProperties",
WindowDidChangeSharingType: "mac:WindowDidChangeSharingType",
WindowDidChangeSpace: "mac:WindowDidChangeSpace",
WindowDidChangeSpaceOrderingMode: "mac:WindowDidChangeSpaceOrderingMode",
WindowDidChangeTitle: "mac:WindowDidChangeTitle",
WindowDidChangeToolbar: "mac:WindowDidChangeToolbar",
WindowDidChangeVisibility: "mac:WindowDidChangeVisibility",
WindowDidDeminiaturize: "mac:WindowDidDeminiaturize",
WindowDidEndSheet: "mac:WindowDidEndSheet",
WindowDidEnterFullScreen: "mac:WindowDidEnterFullScreen",
WindowDidEnterVersionBrowser: "mac:WindowDidEnterVersionBrowser",
WindowDidExitFullScreen: "mac:WindowDidExitFullScreen",
WindowDidExitVersionBrowser: "mac:WindowDidExitVersionBrowser",
WindowDidExpose: "mac:WindowDidExpose",
WindowDidFocus: "mac:WindowDidFocus",
WindowDidMiniaturize: "mac:WindowDidMiniaturize",
WindowDidMove: "mac:WindowDidMove",
WindowDidOrderOffScreen: "mac:WindowDidOrderOffScreen",
WindowDidOrderOnScreen: "mac:WindowDidOrderOnScreen",
WindowDidResignKey: "mac:WindowDidResignKey",
WindowDidResignMain: "mac:WindowDidResignMain",
WindowDidResize: "mac:WindowDidResize",
WindowDidUpdate: "mac:WindowDidUpdate",
WindowDidUpdateAlpha: "mac:WindowDidUpdateAlpha",
WindowDidUpdateCollectionBehavior: "mac:WindowDidUpdateCollectionBehavior",
WindowDidUpdateCollectionProperties: "mac:WindowDidUpdateCollectionProperties",
WindowDidUpdateShadow: "mac:WindowDidUpdateShadow",
WindowDidUpdateTitle: "mac:WindowDidUpdateTitle",
WindowDidUpdateToolbar: "mac:WindowDidUpdateToolbar",
WindowDidUpdateVisibility: "mac:WindowDidUpdateVisibility",
WindowShouldClose: "mac:WindowShouldClose!",
WindowWillBecomeKey: "mac:WindowWillBecomeKey",
WindowWillBecomeMain: "mac:WindowWillBecomeMain",
WindowWillBeginSheet: "mac:WindowWillBeginSheet",
WindowWillChangeOrderingMode: "mac:WindowWillChangeOrderingMode",
WindowWillClose: "mac:WindowWillClose",
WindowWillDeminiaturize: "mac:WindowWillDeminiaturize",
WindowWillEnterFullScreen: "mac:WindowWillEnterFullScreen",
WindowWillEnterVersionBrowser: "mac:WindowWillEnterVersionBrowser",
WindowWillExitFullScreen: "mac:WindowWillExitFullScreen",
WindowWillExitVersionBrowser: "mac:WindowWillExitVersionBrowser",
WindowWillFocus: "mac:WindowWillFocus",
WindowWillMiniaturize: "mac:WindowWillMiniaturize",
WindowWillMove: "mac:WindowWillMove",
WindowWillOrderOffScreen: "mac:WindowWillOrderOffScreen",
WindowWillOrderOnScreen: "mac:WindowWillOrderOnScreen",
WindowWillResignMain: "mac:WindowWillResignMain",
WindowWillResize: "mac:WindowWillResize",
WindowWillUnfocus: "mac:WindowWillUnfocus",
WindowWillUpdate: "mac:WindowWillUpdate",
WindowWillUpdateAlpha: "mac:WindowWillUpdateAlpha",
WindowWillUpdateCollectionBehavior: "mac:WindowWillUpdateCollectionBehavior",
WindowWillUpdateCollectionProperties: "mac:WindowWillUpdateCollectionProperties",
WindowWillUpdateShadow: "mac:WindowWillUpdateShadow",
WindowWillUpdateTitle: "mac:WindowWillUpdateTitle",
WindowWillUpdateToolbar: "mac:WindowWillUpdateToolbar",
WindowWillUpdateVisibility: "mac:WindowWillUpdateVisibility",
WindowWillUseStandardFrame: "mac:WindowWillUseStandardFrame",
MenuWillOpen: "mac:MenuWillOpen",
MenuDidOpen: "mac:MenuDidOpen",
MenuDidClose: "mac:MenuDidClose",
MenuWillSendAction: "mac:MenuWillSendAction",
MenuDidSendAction: "mac:MenuDidSendAction",
MenuWillHighlightItem: "mac:MenuWillHighlightItem",
MenuDidHighlightItem: "mac:MenuDidHighlightItem",
MenuWillDisplayItem: "mac:MenuWillDisplayItem",
MenuDidDisplayItem: "mac:MenuDidDisplayItem",
MenuWillAddItem: "mac:MenuWillAddItem",
MenuDidAddItem: "mac:MenuDidAddItem",
MenuWillRemoveItem: "mac:MenuWillRemoveItem",
MenuDidRemoveItem: "mac:MenuDidRemoveItem",
MenuWillBeginTracking: "mac:MenuWillBeginTracking",
MenuDidBeginTracking: "mac:MenuDidBeginTracking",
MenuWillEndTracking: "mac:MenuWillEndTracking",
MenuDidEndTracking: "mac:MenuDidEndTracking",
MenuWillUpdate: "mac:MenuWillUpdate",
MenuDidUpdate: "mac:MenuDidUpdate",
MenuWillPopUp: "mac:MenuWillPopUp",
MenuDidPopUp: "mac:MenuDidPopUp",
MenuWillSendActionToItem: "mac:MenuWillSendActionToItem",
MenuDidSendActionToItem: "mac:MenuDidSendActionToItem",
WebViewDidStartProvisionalNavigation: "mac:WebViewDidStartProvisionalNavigation",
WebViewDidReceiveServerRedirectForProvisionalNavigation: "mac:WebViewDidReceiveServerRedirectForProvisionalNavigation",
WebViewDidFinishNavigation: "mac:WebViewDidFinishNavigation",
WebViewDidCommitNavigation: "mac:WebViewDidCommitNavigation",
WindowFileDraggingEntered: "mac:WindowFileDraggingEntered",
WindowFileDraggingPerformed: "mac:WindowFileDraggingPerformed",
WindowFileDraggingExited: "mac:WindowFileDraggingExited",
},
Linux: {
SystemThemeChanged: "linux:SystemThemeChanged",
},
Common: {
ApplicationStarted: "common:ApplicationStarted",
WindowMaximise: "common:WindowMaximise",
WindowUnMaximise: "common:WindowUnMaximise",
WindowFullscreen: "common:WindowFullscreen",
WindowUnFullscreen: "common:WindowUnFullscreen",
WindowRestore: "common:WindowRestore",
WindowMinimise: "common:WindowMinimise",
WindowUnMinimise: "common:WindowUnMinimise",
WindowClosing: "common:WindowClosing",
WindowZoom: "common:WindowZoom",
WindowZoomIn: "common:WindowZoomIn",
WindowZoomOut: "common:WindowZoomOut",
WindowZoomReset: "common:WindowZoomReset",
WindowFocus: "common:WindowFocus",
WindowLostFocus: "common:WindowLostFocus",
WindowShow: "common:WindowShow",
WindowHide: "common:WindowHide",
WindowDPIChanged: "common:WindowDPIChanged",
WindowFilesDropped: "common:WindowFilesDropped",
ThemeChanged: "common:ThemeChanged",
ApplicationTerminate: "common:ApplicationTerminate",
},
};

View file

@ -15,6 +15,9 @@ The electron alternative for Go
*/
import {newRuntimeCallerWithID, objectNames} from "./runtime";
import {EventTypes} from "./event_types";
export const Types = EventTypes;
const call = newRuntimeCallerWithID(objectNames.Events, '');
const EmitMethod = 0;
const eventListeners = new Map();
@ -43,7 +46,7 @@ export class WailsEvent {
window._wails = window._wails || {};
window._wails.dispatchWailsEvent = dispatchWailsEvent;
export function dispatchWailsEvent(event) {
function dispatchWailsEvent(event) {
let listeners = eventListeners.get(event.name);
if (listeners) {
let toRemove = listeners.filter(listener => {

View file

@ -1,136 +0,0 @@
declare module '@wailsio/runtime';
/**
* Describes the properties of a Button object.
*/
export interface Button {
// Text that appears within the button.
Label?: string;
// True if the button should cancel an operation when clicked.
IsCancel?: boolean;
// True if the button should be the default action when the user presses enter.
IsDefault?: boolean;
}
/**
* Describes the properties of a FileFilter object.
*/
export interface FileFilter {
// Display name for the filter, it could be "Text Files", "Images" etc.
DisplayName?: string;
// Pattern to match for the filter, e.g. "*.txt;*.md" for text markdown files.
Pattern?: string;
}
/**
* Describes the properties of a Position object.
*/
export interface Position {
X: number;
Y: number;
}
/**
* Describes the properties of a Size object.
* Extends the properties of Position.
*/
export type Size = Position;
/**
* Describes the properties of a Rect object.
* Extends the properties of Size.
*/
export type Rect = Size & Position;
/**
* Describes the possible rotations a Screen can have.
*/
export enum Rotation {
Zero = 0,
Ninety = 90,
OneEighty = 180,
TwoSeventy = 270
}
/**
* Describes the properties of a Screen object.
*/
export interface Screen {
// Unique identifier for the screen.
Id: string;
// Human readable name of the screen.
Name: string;
// The resolution scale of the screen. 1 = standard resolution, 2 = high (Retina), etc.
Scale: number;
// Contains the X and Y coordinates of the screen's position.
Position: Position;
// Contains the width and height of the screen.
Size: Size;
// Contains the bounds of the screen in terms of X, Y, Width, and Height.
Bounds: Rect;
// Contains the area of the screen that is actually usable (excluding taskbar and other system UI).
WorkArea: Rect;
// True if this is the primary monitor selected by the user in the operating system.
IsPrimary: boolean;
// The rotation of the screen. Can be one of 0, 90, 180, 270 degrees.
Rotation: Rotation;
}
/**
* Describes the properties of a MessageDialogOptions object.
*/
export interface MessageDialogOptions {
// The title of the dialog window.
Title?: string;
// The main message to show in the dialog.
Message?: string;
// Array of button options to show in the dialog.
Buttons?: Button[];
// True if the dialog should appear detached from the main window (if applicable).
Detached?: boolean;
}
/**
* Describes the properties common to OpenFileDialogOptions and SaveFileDialogOptions objects.
*/
export interface DialogOptions {
CanChooseDirectories?: boolean;
CanChooseFiles?: boolean;
CanCreateDirectories?: boolean;
ShowHiddenFiles?: boolean;
ResolvesAliases?: boolean;
AllowsMultipleSelection?: boolean;
HideExtension?: boolean;
CanSelectHiddenExtension?: boolean;
TreatsFilePackagesAsDirectories?: boolean;
AllowsOtherFiletypes?: boolean;
Filters?: FileFilter[];
Title?: string;
Message?: string;
ButtonText?: string;
Directory?: string;
Detached?: boolean;
}
/**
* Describes properties unique to OpenFileDialogOptions.
*/
export type OpenFileDialogOptions = DialogOptions;
/**
* Describes properties unique to SaveFileDialogOptions.
*/
export type SaveFileDialogOptions = DialogOptions & {
// Default filename to use for the save dialog.
Filename?: string;
};
/**
* Describes the properties of a WailsEvent object.
*/
export interface WailsEvent {
// The name of the event.
Name: string;
// Any data associated with the event.
Data?: unknown;
}

View file

@ -10,45 +10,22 @@ The electron alternative for Go
import {setupContextMenus} from "./contextmenu";
import {setupDrag} from "./drag";
import {Emit, Off, OffAll, On, Once, OnMultiple, WailsEvent} from './events';
import {ByID, ByName, Plugin} from "./calls";
import {Error, Info, OpenFile, Question, SaveFile, Warning} from "./dialogs";
import * as Application from "./application";
import * as Browser from "./browser";
import * as Clipboard from "./clipboard";
import * as ContextMenu from "./contextmenu";
import * as Flags from "./flags";
import * as Runtime from "./runtime";
import * as Screens from "./screens";
import * as System from "./system";
import * as Window from "./window";
import * as WML from './wml';
import * as Events from "./events";
import * as Dialogs from "./dialogs";
import * as Call from "./calls";
export { Application, Browser, Clipboard, ContextMenu, Flags, Runtime, Screens, System, Window, WML };
export { Application, Browser, Call, Clipboard, Dialogs, Events, Flags, Screens, System, Window, WML};
export const Events = {
On,
Off,
OnMultiple,
WailsEvent,
OffAll,
Emit,
Once
}
export const Call = {
Plugin,
ByID,
ByName
}
export const Dialogs = {
Info,
Error,
OpenFile, Question, Warning, SaveFile
}
/***
This technique for proper load detection is taken from HTMX:

View file

@ -10,10 +10,21 @@ The electron alternative for Go
/* jshint esversion: 9 */
/**
* @typedef {import("./api/types").Screen} Screen
* @typedef {Object} Screen
* @property {string} Id - Unique identifier for the screen.
* @property {string} Name - Human readable name of the screen.
* @property {number} Scale - The resolution scale of the screen. 1 = standard resolution, 2 = high (Retina), etc.
* @property {Position} Position - Contains the X and Y coordinates of the screen's position.
* @property {Size} Size - Contains the width and height of the screen.
* @property {Rect} Bounds - Contains the bounds of the screen in terms of X, Y, Width, and Height.
* @property {Rect} WorkArea - Contains the area of the screen that is actually usable (excluding taskbar and other system UI).
* @property {boolean} IsPrimary - True if this is the primary monitor selected by the user in the operating system.
* @property {Rotation} Rotation - The rotation of the screen.
*/
import {newRuntimeCallerWithID, objectNames} from "./runtime";
const call = newRuntimeCallerWithID(objectNames.Screens, '');

View file

@ -10,12 +10,38 @@ The electron alternative for Go
/* jshint esversion: 9 */
// Import screen jsdoc definition from ./screens.js
/**
* @typedef {import("../api/types").Size} Size
* @typedef {import("../api/types").Position} Position
* @typedef {import("../api/types").Screen} Screen
* @typedef {import("./screens").Screen} Screen
*/
/**
* @typedef {Object} Position
* @property {number} X - The X coordinate.
* @property {number} Y - The Y coordinate.
*/
/**
* @typedef {Object} Size
* @property {number} X - The width.
* @property {number} Y - The height.
*/
/**
* @typedef {Object} Rect
* @property {number} X - The X coordinate of the top-left corner.
* @property {number} Y - The Y coordinate of the top-left corner.
* @property {number} Width - The width of the rectangle.
* @property {number} Height - The height of the rectangle.
*/
/**
* @typedef {('Zero'|'Ninety'|'OneEighty'|'TwoSeventy')} Rotation
* The rotation of the screen. Can be one of 'Zero', 'Ninety', 'OneEighty', 'TwoSeventy'.
*/
import {newRuntimeCallerWithID, objectNames} from "./runtime";
const center = 0;
@ -49,7 +75,7 @@ const zoomReset = 27;
const getZoomLevel = 28;
const setZoomLevel = 29;
const thisWindow = newRuntimeCallerWithID(objectNames.Window, '');
const thisWindow = Get('');
function createWindow(call) {
return {
@ -98,25 +124,220 @@ export function Get(windowName) {
}
/**
* Returns a map of all methods in the current window.
* @returns {Map} - A map of window methods.
* Centers the window on the screen.
*/
export function WindowMethods(targetWindow) {
// Create a new map to store methods
let result = new Map();
// Iterate over all properties of the window object
for (let method in targetWindow) {
// Check if the property is indeed a method (function)
if(typeof targetWindow[method] === 'function') {
// Add the method to the map
result.set(method, targetWindow[method]);
}
}
// Return the map of window methods
return result;
export function Center() {
thisWindow.Center();
}
export default {
...Get('')
/**
* Sets the title of the window.
* @param {string} title - The title to set.
*/
export function SetTitle(title) {
thisWindow.SetTitle(title);
}
/**
* Sets the window to fullscreen.
*/
export function Fullscreen() {
thisWindow.Fullscreen();
}
/**
* Sets the size of the window.
* @param {number} width - The width of the window.
* @param {number} height - The height of the window.
*/
export function SetSize(width, height) {
thisWindow.SetSize(width, height);
}
/**
* Gets the size of the window.
*/
export function Size() {
return thisWindow.Size();
}
/**
* Sets the maximum size of the window.
* @param {number} width - The maximum width of the window.
* @param {number} height - The maximum height of the window.
*/
export function SetMaxSize(width, height) {
thisWindow.SetMaxSize(width, height);
}
/**
* Sets the minimum size of the window.
* @param {number} width - The minimum width of the window.
* @param {number} height - The minimum height of the window.
*/
export function SetMinSize(width, height) {
thisWindow.SetMinSize(width, height);
}
/**
* Sets the window to always be on top.
* @param {boolean} onTop - Whether the window should always be on top.
*/
export function SetAlwaysOnTop(onTop) {
thisWindow.SetAlwaysOnTop(onTop);
}
/**
* Sets the relative position of the window.
* @param {number} x - The x-coordinate of the window's position.
* @param {number} y - The y-coordinate of the window's position.
*/
export function SetRelativePosition(x, y) {
thisWindow.SetRelativePosition(x, y);
}
/**
* Gets the relative position of the window.
*/
export function RelativePosition() {
return thisWindow.RelativePosition();
}
/**
* Gets the screen that the window is on.
*/
export function Screen() {
return thisWindow.Screen();
}
/**
* Hides the window.
*/
export function Hide() {
thisWindow.Hide();
}
/**
* Maximises the window.
*/
export function Maximise() {
thisWindow.Maximise();
}
/**
* Un-maximises the window.
*/
export function UnMaximise() {
thisWindow.UnMaximise();
}
/**
* Toggles the maximisation of the window.
*/
export function ToggleMaximise() {
thisWindow.ToggleMaximise();
}
/**
* Minimises the window.
*/
export function Minimise() {
thisWindow.Minimise();
}
/**
* Un-minimises the window.
*/
export function UnMinimise() {
thisWindow.UnMinimise();
}
/**
* Restores the window.
*/
export function Restore() {
thisWindow.Restore();
}
/**
* Shows the window.
*/
export function Show() {
thisWindow.Show();
}
/**
* Closes the window.
*/
export function Close() {
thisWindow.Close();
}
/**
* Sets the background colour of the window.
* @param {number} r - The red component of the colour.
* @param {number} g - The green component of the colour.
* @param {number} b - The blue component of the colour.
* @param {number} a - The alpha component of the colour.
*/
export function SetBackgroundColour(r, g, b, a) {
thisWindow.SetBackgroundColour(r, g, b, a);
}
/**
* Sets whether the window is resizable.
* @param {boolean} resizable - Whether the window should be resizable.
*/
export function SetResizable(resizable) {
thisWindow.SetResizable(resizable);
}
/**
* Gets the width of the window.
*/
export function Width() {
return thisWindow.Width();
}
/**
* Gets the height of the window.
*/
export function Height() {
return thisWindow.Height();
}
/**
* Zooms in the window.
*/
export function ZoomIn() {
thisWindow.ZoomIn();
}
/**
* Zooms out the window.
*/
export function ZoomOut() {
thisWindow.ZoomOut();
}
/**
* Resets the zoom of the window.
*/
export function ZoomReset() {
thisWindow.ZoomReset();
}
/**
* Gets the zoom level of the window.
*/
export function GetZoomLevel() {
return thisWindow.GetZoomLevel();
}
/**
* Sets the zoom level of the window.
* @param {number} zoomLevel - The zoom level to set.
*/
export function SetZoomLevel(zoomLevel) {
thisWindow.SetZoomLevel(zoomLevel);
}

View file

@ -1,7 +1,7 @@
import {Emit, WailsEvent} from "./events";
import {Question} from "./dialogs";
import {WindowMethods, Get} from "./window";
import {Get} from "./window";
import {OpenURL} from "./browser";
/**
@ -149,3 +149,24 @@ export function Reload() {
addWMLWindowListeners();
addWMLOpenBrowserListener();
}
/**
* Returns a map of all methods in the current window.
* @returns {Map} - A map of window methods.
*/
function WindowMethods(targetWindow) {
// Create a new map to store methods
let result = new Map();
// Iterate over all properties of the window object
for (let method in targetWindow) {
// Check if the property is indeed a method (function)
if(typeof targetWindow[method] === 'function') {
// Add the method to the map
result.set(method, targetWindow[method]);
}
}
// Return the map of window methods
return result;
}

View file

@ -1,5 +1,3 @@
export function resultHandler(id: any, data: any, isJSON: any): void;
export function errorHandler(id: any, message: any): void;
/**
* Call method.
*

View file

@ -1,28 +1,184 @@
/**
* Handles the callback from a dialog.
*
* @param {string} id - The ID of the dialog response.
* @param {string} data - The data received from the dialog.
* @param {boolean} isJSON - Flag indicating whether the data is in JSON format.
*
* @return {undefined}
*/
export function dialogResultCallback(id: string, data: string, isJSON: boolean): undefined;
/**
* Callback function for handling errors in dialog.
*
* @param {string} id - The id of the dialog response.
* @param {string} message - The error message.
*
* @return {void}
*/
export function dialogErrorCallback(id: string, message: string): void;
export function Info(options: any): Promise<string>;
export function Warning(options: any): Promise<string>;
export function Error(options: any): Promise<string>;
export function Question(options: any): Promise<string>;
export function OpenFile(options: any): Promise<string[] | string>;
export function SaveFile(options: any): Promise<string>;
export type MessageDialogOptions = any;
export type OpenDialogOptions = any;
export type SaveDialogOptions = any;
export function Info(options: MessageDialogOptions): Promise<string>;
export function Warning(options: MessageDialogOptions): Promise<string>;
export function Error(options: MessageDialogOptions): Promise<string>;
export function Question(options: MessageDialogOptions): Promise<string>;
export function OpenFile(options: OpenFileDialogOptions): Promise<string[] | string>;
export function SaveFile(options: SaveFileDialogOptions): Promise<string>;
export type OpenFileDialogOptions = {
/**
* - Indicates if directories can be chosen.
*/
CanChooseDirectories?: boolean;
/**
* - Indicates if files can be chosen.
*/
CanChooseFiles?: boolean;
/**
* - Indicates if directories can be created.
*/
CanCreateDirectories?: boolean;
/**
* - Indicates if hidden files should be shown.
*/
ShowHiddenFiles?: boolean;
/**
* - Indicates if aliases should be resolved.
*/
ResolvesAliases?: boolean;
/**
* - Indicates if multiple selection is allowed.
*/
AllowsMultipleSelection?: boolean;
/**
* - Indicates if the extension should be hidden.
*/
HideExtension?: boolean;
/**
* - Indicates if hidden extensions can be selected.
*/
CanSelectHiddenExtension?: boolean;
/**
* - Indicates if file packages should be treated as directories.
*/
TreatsFilePackagesAsDirectories?: boolean;
/**
* - Indicates if other file types are allowed.
*/
AllowsOtherFiletypes?: boolean;
/**
* - Array of file filters.
*/
Filters?: FileFilter[];
/**
* - Title of the dialog.
*/
Title?: string;
/**
* - Message to show in the dialog.
*/
Message?: string;
/**
* - Text to display on the button.
*/
ButtonText?: string;
/**
* - Directory to open in the dialog.
*/
Directory?: string;
/**
* - Indicates if the dialog should appear detached from the main window.
*/
Detached?: boolean;
};
export type SaveFileDialogOptions = {
/**
* - Default filename to use in the dialog.
*/
Filename?: string;
/**
* - Indicates if directories can be chosen.
*/
CanChooseDirectories?: boolean;
/**
* - Indicates if files can be chosen.
*/
CanChooseFiles?: boolean;
/**
* - Indicates if directories can be created.
*/
CanCreateDirectories?: boolean;
/**
* - Indicates if hidden files should be shown.
*/
ShowHiddenFiles?: boolean;
/**
* - Indicates if aliases should be resolved.
*/
ResolvesAliases?: boolean;
/**
* - Indicates if multiple selection is allowed.
*/
AllowsMultipleSelection?: boolean;
/**
* - Indicates if the extension should be hidden.
*/
HideExtension?: boolean;
/**
* - Indicates if hidden extensions can be selected.
*/
CanSelectHiddenExtension?: boolean;
/**
* - Indicates if file packages should be treated as directories.
*/
TreatsFilePackagesAsDirectories?: boolean;
/**
* - Indicates if other file types are allowed.
*/
AllowsOtherFiletypes?: boolean;
/**
* - Array of file filters.
*/
Filters?: FileFilter[];
/**
* - Title of the dialog.
*/
Title?: string;
/**
* - Message to show in the dialog.
*/
Message?: string;
/**
* - Text to display on the button.
*/
ButtonText?: string;
/**
* - Directory to open in the dialog.
*/
Directory?: string;
/**
* - Indicates if the dialog should appear detached from the main window.
*/
Detached?: boolean;
};
export type MessageDialogOptions = {
/**
* - The title of the dialog window.
*/
Title?: string;
/**
* - The main message to show in the dialog.
*/
Message?: string;
/**
* - Array of button options to show in the dialog.
*/
Buttons?: Button[];
/**
* - True if the dialog should appear detached from the main window (if applicable).
*/
Detached?: boolean;
};
export type Button = {
/**
* - Text that appears within the button.
*/
Label?: string;
/**
* - True if the button should cancel an operation when clicked.
*/
IsCancel?: boolean;
/**
* - True if the button should be the default action when the user presses enter.
*/
IsDefault?: boolean;
};
export type FileFilter = {
/**
* - Display name for the filter, it could be "Text Files", "Images" etc.
*/
DisplayName?: string;
/**
* - Pattern to match for the filter, e.g. "*.txt;*.md" for text markdown files.
*/
Pattern?: string;
};

View file

@ -0,0 +1,183 @@
export declare const EventTypes: {
Windows: {
SystemThemeChanged: string,
APMPowerStatusChange: string,
APMSuspend: string,
APMResumeAutomatic: string,
APMResumeSuspend: string,
APMPowerSettingChange: string,
ApplicationStarted: string,
WebViewNavigationCompleted: string,
WindowInactive: string,
WindowActive: string,
WindowClickActive: string,
WindowMaximise: string,
WindowUnMaximise: string,
WindowFullscreen: string,
WindowUnFullscreen: string,
WindowRestore: string,
WindowMinimise: string,
WindowUnMinimise: string,
WindowClose: string,
WindowSetFocus: string,
WindowKillFocus: string,
WindowDragDrop: string,
WindowDragEnter: string,
WindowDragLeave: string,
WindowDragOver: string,
},
Mac: {
ApplicationDidBecomeActive: string,
ApplicationDidChangeBackingProperties: string,
ApplicationDidChangeEffectiveAppearance: string,
ApplicationDidChangeIcon: string,
ApplicationDidChangeOcclusionState: string,
ApplicationDidChangeScreenParameters: string,
ApplicationDidChangeStatusBarFrame: string,
ApplicationDidChangeStatusBarOrientation: string,
ApplicationDidFinishLaunching: string,
ApplicationDidHide: string,
ApplicationDidResignActiveNotification: string,
ApplicationDidUnhide: string,
ApplicationDidUpdate: string,
ApplicationWillBecomeActive: string,
ApplicationWillFinishLaunching: string,
ApplicationWillHide: string,
ApplicationWillResignActive: string,
ApplicationWillTerminate: string,
ApplicationWillUnhide: string,
ApplicationWillUpdate: string,
ApplicationTerminate: string,
ApplicationDidChangeTheme: string,
ApplicationShouldHandleReopen: string,
WindowDidBecomeKey: string,
WindowDidBecomeMain: string,
WindowDidBeginSheet: string,
WindowDidChangeAlpha: string,
WindowDidChangeBackingLocation: string,
WindowDidChangeBackingProperties: string,
WindowDidChangeCollectionBehavior: string,
WindowDidChangeEffectiveAppearance: string,
WindowDidChangeOcclusionState: string,
WindowDidChangeOrderingMode: string,
WindowDidChangeScreen: string,
WindowDidChangeScreenParameters: string,
WindowDidChangeScreenProfile: string,
WindowDidChangeScreenSpace: string,
WindowDidChangeScreenSpaceProperties: string,
WindowDidChangeSharingType: string,
WindowDidChangeSpace: string,
WindowDidChangeSpaceOrderingMode: string,
WindowDidChangeTitle: string,
WindowDidChangeToolbar: string,
WindowDidChangeVisibility: string,
WindowDidDeminiaturize: string,
WindowDidEndSheet: string,
WindowDidEnterFullScreen: string,
WindowDidEnterVersionBrowser: string,
WindowDidExitFullScreen: string,
WindowDidExitVersionBrowser: string,
WindowDidExpose: string,
WindowDidFocus: string,
WindowDidMiniaturize: string,
WindowDidMove: string,
WindowDidOrderOffScreen: string,
WindowDidOrderOnScreen: string,
WindowDidResignKey: string,
WindowDidResignMain: string,
WindowDidResize: string,
WindowDidUpdate: string,
WindowDidUpdateAlpha: string,
WindowDidUpdateCollectionBehavior: string,
WindowDidUpdateCollectionProperties: string,
WindowDidUpdateShadow: string,
WindowDidUpdateTitle: string,
WindowDidUpdateToolbar: string,
WindowDidUpdateVisibility: string,
WindowShouldClose: string,
WindowWillBecomeKey: string,
WindowWillBecomeMain: string,
WindowWillBeginSheet: string,
WindowWillChangeOrderingMode: string,
WindowWillClose: string,
WindowWillDeminiaturize: string,
WindowWillEnterFullScreen: string,
WindowWillEnterVersionBrowser: string,
WindowWillExitFullScreen: string,
WindowWillExitVersionBrowser: string,
WindowWillFocus: string,
WindowWillMiniaturize: string,
WindowWillMove: string,
WindowWillOrderOffScreen: string,
WindowWillOrderOnScreen: string,
WindowWillResignMain: string,
WindowWillResize: string,
WindowWillUnfocus: string,
WindowWillUpdate: string,
WindowWillUpdateAlpha: string,
WindowWillUpdateCollectionBehavior: string,
WindowWillUpdateCollectionProperties: string,
WindowWillUpdateShadow: string,
WindowWillUpdateTitle: string,
WindowWillUpdateToolbar: string,
WindowWillUpdateVisibility: string,
WindowWillUseStandardFrame: string,
MenuWillOpen: string,
MenuDidOpen: string,
MenuDidClose: string,
MenuWillSendAction: string,
MenuDidSendAction: string,
MenuWillHighlightItem: string,
MenuDidHighlightItem: string,
MenuWillDisplayItem: string,
MenuDidDisplayItem: string,
MenuWillAddItem: string,
MenuDidAddItem: string,
MenuWillRemoveItem: string,
MenuDidRemoveItem: string,
MenuWillBeginTracking: string,
MenuDidBeginTracking: string,
MenuWillEndTracking: string,
MenuDidEndTracking: string,
MenuWillUpdate: string,
MenuDidUpdate: string,
MenuWillPopUp: string,
MenuDidPopUp: string,
MenuWillSendActionToItem: string,
MenuDidSendActionToItem: string,
WebViewDidStartProvisionalNavigation: string,
WebViewDidReceiveServerRedirectForProvisionalNavigation: string,
WebViewDidFinishNavigation: string,
WebViewDidCommitNavigation: string,
WindowFileDraggingEntered: string,
WindowFileDraggingPerformed: string,
WindowFileDraggingExited: string,
},
Linux: {
SystemThemeChanged: string,
},
Common: {
ApplicationStarted: string,
WindowMaximise: string,
WindowUnMaximise: string,
WindowFullscreen: string,
WindowUnFullscreen: string,
WindowRestore: string,
WindowMinimise: string,
WindowUnMinimise: string,
WindowClosing: string,
WindowZoom: string,
WindowZoomIn: string,
WindowZoomOut: string,
WindowZoomReset: string,
WindowFocus: string,
WindowLostFocus: string,
WindowShow: string,
WindowHide: string,
WindowDPIChanged: string,
WindowFilesDropped: string,
ThemeChanged: string,
ApplicationTerminate: string,
},
};

View file

@ -1,4 +1,3 @@
export function dispatchWailsEvent(event: any): void;
/**
* Register a callback function to be called multiple times for a specific event.
*
@ -46,6 +45,197 @@ export function OffAll(): void;
* @returns {any} - The result of the emitted event.
*/
export function Emit(event: WailsEvent): any;
export const Types: {
Windows: {
SystemThemeChanged: string;
APMPowerStatusChange: string;
APMSuspend: string;
APMResumeAutomatic: string;
APMResumeSuspend: string;
APMPowerSettingChange: string;
ApplicationStarted: string;
WebViewNavigationCompleted: string;
WindowInactive: string;
WindowActive: string;
WindowClickActive: string;
WindowMaximise: string;
WindowUnMaximise: string;
WindowFullscreen: string;
WindowUnFullscreen: string;
WindowRestore: string;
WindowMinimise: string;
WindowUnMinimise: string;
WindowClose: string;
WindowSetFocus: string;
WindowKillFocus: string;
WindowDragDrop: string;
WindowDragEnter: string;
WindowDragLeave: string;
WindowDragOver: string;
};
Mac: {
ApplicationDidBecomeActive: string;
ApplicationDidChangeBackingProperties: string;
ApplicationDidChangeEffectiveAppearance: string;
ApplicationDidChangeIcon: string;
ApplicationDidChangeOcclusionState: string;
ApplicationDidChangeScreenParameters: string;
/**
* Register a callback function to be called multiple times for a specific event.
*
* @param {string} eventName - The name of the event to register the callback for.
* @param {function} callback - The callback function to be called when the event is triggered.
* @param {number} maxCallbacks - The maximum number of times the callback can be called for the event. Once the maximum number is reached, the callback will no longer be called.
*
@return {function} - A function that, when called, will unregister the callback from the event.
*/
ApplicationDidChangeStatusBarFrame: string;
ApplicationDidChangeStatusBarOrientation: string;
ApplicationDidFinishLaunching: string;
ApplicationDidHide: string;
ApplicationDidResignActiveNotification: string;
ApplicationDidUnhide: string;
ApplicationDidUpdate: string;
ApplicationWillBecomeActive: string;
ApplicationWillFinishLaunching: string;
ApplicationWillHide: string;
ApplicationWillResignActive: string;
ApplicationWillTerminate: string;
ApplicationWillUnhide: string;
ApplicationWillUpdate: string;
ApplicationTerminate: string;
ApplicationDidChangeTheme: string;
ApplicationShouldHandleReopen: string;
WindowDidBecomeKey: string;
WindowDidBecomeMain: string;
WindowDidBeginSheet: string;
WindowDidChangeAlpha: string;
WindowDidChangeBackingLocation: string;
WindowDidChangeBackingProperties: string;
WindowDidChangeCollectionBehavior: string;
WindowDidChangeEffectiveAppearance: string;
WindowDidChangeOcclusionState: string;
WindowDidChangeOrderingMode: string;
WindowDidChangeScreen: string;
WindowDidChangeScreenParameters: string;
WindowDidChangeScreenProfile: string;
WindowDidChangeScreenSpace: string;
WindowDidChangeScreenSpaceProperties: string;
WindowDidChangeSharingType: string;
WindowDidChangeSpace: string;
WindowDidChangeSpaceOrderingMode: string;
WindowDidChangeTitle: string;
WindowDidChangeToolbar: string;
WindowDidChangeVisibility: string;
WindowDidDeminiaturize: string;
WindowDidEndSheet: string;
WindowDidEnterFullScreen: string;
WindowDidEnterVersionBrowser: string;
WindowDidExitFullScreen: string;
WindowDidExitVersionBrowser: string;
WindowDidExpose: string;
WindowDidFocus: string;
WindowDidMiniaturize: string;
WindowDidMove: string;
WindowDidOrderOffScreen: string;
WindowDidOrderOnScreen: string;
WindowDidResignKey: string;
WindowDidResignMain: string;
WindowDidResize: string;
WindowDidUpdate: string;
WindowDidUpdateAlpha: string;
WindowDidUpdateCollectionBehavior: string;
WindowDidUpdateCollectionProperties: string;
WindowDidUpdateShadow: string;
WindowDidUpdateTitle: string;
WindowDidUpdateToolbar: string;
WindowDidUpdateVisibility: string;
WindowShouldClose: string;
WindowWillBecomeKey: string;
WindowWillBecomeMain: string;
WindowWillBeginSheet: string;
WindowWillChangeOrderingMode: string;
WindowWillClose: string;
WindowWillDeminiaturize: string;
WindowWillEnterFullScreen: string;
WindowWillEnterVersionBrowser: string;
WindowWillExitFullScreen: string;
WindowWillExitVersionBrowser: string;
WindowWillFocus: string;
WindowWillMiniaturize: string;
WindowWillMove: string;
WindowWillOrderOffScreen: string;
WindowWillOrderOnScreen: string;
WindowWillResignMain: string;
WindowWillResize: string;
WindowWillUnfocus: string;
WindowWillUpdate: string;
WindowWillUpdateAlpha: string;
WindowWillUpdateCollectionBehavior: string;
WindowWillUpdateCollectionProperties: string;
WindowWillUpdateShadow: string;
WindowWillUpdateTitle: string;
WindowWillUpdateToolbar: string;
WindowWillUpdateVisibility: string;
WindowWillUseStandardFrame: string;
MenuWillOpen: string;
MenuDidOpen: string;
MenuDidClose: string;
MenuWillSendAction: string;
MenuDidSendAction: string;
MenuWillHighlightItem: string;
MenuDidHighlightItem: string;
MenuWillDisplayItem: string;
MenuDidDisplayItem: string;
MenuWillAddItem: string;
MenuDidAddItem: string;
MenuWillRemoveItem: string;
MenuDidRemoveItem: string;
MenuWillBeginTracking: string;
MenuDidBeginTracking: string;
MenuWillEndTracking: string;
MenuDidEndTracking: string;
MenuWillUpdate: string;
MenuDidUpdate: string;
MenuWillPopUp: string;
MenuDidPopUp: string;
MenuWillSendActionToItem: string;
MenuDidSendActionToItem: string;
WebViewDidStartProvisionalNavigation: string;
WebViewDidReceiveServerRedirectForProvisionalNavigation: string;
WebViewDidFinishNavigation: string;
WebViewDidCommitNavigation: string;
WindowFileDraggingEntered: string;
WindowFileDraggingPerformed: string;
WindowFileDraggingExited: string;
};
Linux: {
SystemThemeChanged: string;
};
Common: {
ApplicationStarted: string;
WindowMaximise: string;
WindowUnMaximise: string;
WindowFullscreen: string;
WindowUnFullscreen: string;
WindowRestore: string;
WindowMinimise: string;
WindowUnMinimise: string;
WindowClosing: string;
WindowZoom: string;
WindowZoomIn: string;
WindowZoomOut: string;
WindowZoomReset: string;
WindowFocus: string;
WindowLostFocus: string;
WindowShow: string;
WindowHide: string;
WindowDPIChanged: string;
WindowFilesDropped: string;
ThemeChanged: string;
ApplicationTerminate: string;
};
};
export class WailsEvent {
constructor(name: any, data?: any);
name: any;

View file

@ -1,49 +1,12 @@
export namespace Events {
export { On };
export { Off };
export { OnMultiple };
export { WailsEvent };
export { OffAll };
export { Emit };
export { Once };
}
export namespace Call {
export { Plugin };
export { ByID };
export { ByName };
}
export namespace Dialogs {
export { Info };
export { Error };
export { OpenFile };
export { Question };
export { Warning };
export { SaveFile };
}
import * as Application from "./application";
import * as Browser from "./browser";
import * as Call from "./calls";
import * as Clipboard from "./clipboard";
import * as ContextMenu from "./contextmenu";
import * as Dialogs from "./dialogs";
import * as Events from "./events";
import * as Flags from "./flags";
import * as Runtime from "./runtime";
import * as Screens from "./screens";
import * as System from "./system";
import * as Window from "./window";
import * as WML from "./wml";
import { On } from './events';
import { Off } from './events';
import { OnMultiple } from './events';
import { WailsEvent } from './events';
import { OffAll } from './events';
import { Emit } from './events';
import { Once } from './events';
import { Plugin } from "./calls";
import { ByID } from "./calls";
import { ByName } from "./calls";
import { Info } from "./dialogs";
import { Error } from "./dialogs";
import { OpenFile } from "./dialogs";
import { Question } from "./dialogs";
import { Warning } from "./dialogs";
import { SaveFile } from "./dialogs";
export { Application, Browser, Clipboard, ContextMenu, Flags, Runtime, Screens, System, Window, WML };
import * as WML from './wml';
export { Application, Browser, Call, Clipboard, Dialogs, Events, Flags, Screens, System, Window, WML };

View file

@ -14,4 +14,41 @@ export function GetPrimary(): Promise<Screen>;
* @returns {Promise<Screen>} A promise that resolves with the current active screen.
*/
export function GetCurrent(): Promise<Screen>;
export type Screen = any;
export type Screen = {
/**
* - Unique identifier for the screen.
*/
Id: string;
/**
* - Human readable name of the screen.
*/
Name: string;
/**
* - The resolution scale of the screen. 1 = standard resolution, 2 = high (Retina), etc.
*/
Scale: number;
/**
* - Contains the X and Y coordinates of the screen's position.
*/
Position: Position;
/**
* - Contains the width and height of the screen.
*/
Size: Size;
/**
* - Contains the bounds of the screen in terms of X, Y, Width, and Height.
*/
Bounds: Rect;
/**
* - Contains the area of the screen that is actually usable (excluding taskbar and other system UI).
*/
WorkArea: Rect;
/**
* - True if this is the primary monitor selected by the user in the operating system.
*/
IsPrimary: boolean;
/**
* - The rotation of the screen.
*/
Rotation: Rotation;
};

View file

@ -5,13 +5,48 @@
* @return {Object} - The specified window object.
*/
export function Get(windowName: string): any;
/**
* Returns a map of all methods in the current window.
* @returns {Map} - A map of window methods.
*/
export function WindowMethods(targetWindow: any): Map<any, any>;
declare const _default: any;
export default _default;
export type Size = any;
export type Position = any;
export type Screen = any;
export type Screen = import("./screens").Screen;
export type Position = {
/**
* - The X coordinate.
*/
X: number;
/**
* - The Y coordinate.
*/
Y: number;
};
export type Size = {
/**
* - The width.
*/
X: number;
/**
* - The height.
*/
Y: number;
};
export type Rect = {
/**
* - The X coordinate of the top-left corner.
*/
X: number;
/**
* - The Y coordinate of the top-left corner.
*/
Y: number;
/**
* - The width of the rectangle.
*/
Width: number;
/**
* - The height of the rectangle.
*/
Height: number;
};
/**
* The rotation of the screen. Can be one of 'Zero', 'Ninety', 'OneEighty', 'TwoSeventy'.
*/
export type Rotation = ('Zero' | 'Ninety' | 'OneEighty' | 'TwoSeventy');

View file

@ -1,5 +1,5 @@
/**
* Reloads the WML system by adding necessary event listeners and browser listeners.
* Reloads the WML page by adding necessary event listeners and browser listeners.
*
* @return {void}
*/