diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index e635dfabc..9e236c212 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -4,7 +4,7 @@ on:
push:
branches:
- develop
- pull_request:
+ # pull_request:
release:
types:
- released
diff --git a/packages/ens-subgraph/.gitignore b/packages/ens-subgraph/.gitignore
new file mode 100644
index 000000000..a43c8d229
--- /dev/null
+++ b/packages/ens-subgraph/.gitignore
@@ -0,0 +1,79 @@
+# Graph cli generated
+src/types
+build/
+.DS_STORE
+
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Built output
+dist
+build
+generated
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (https://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules/
+jspm_packages/
+dist/
+
+
+# TypeScript v1 declaration files
+typings/
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variables file
+.env
+
+# next.js build output
+.next
+
+# intellij
+.idea
+
+/tests/.bin
+/tests/.latest.json
diff --git a/packages/ens-subgraph/.vscode/settings.json b/packages/ens-subgraph/.vscode/settings.json
new file mode 100644
index 000000000..25fa6215f
--- /dev/null
+++ b/packages/ens-subgraph/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "typescript.tsdk": "node_modules/typescript/lib"
+}
diff --git a/packages/ens-subgraph/README.md b/packages/ens-subgraph/README.md
new file mode 100644
index 000000000..5bfedccbb
--- /dev/null
+++ b/packages/ens-subgraph/README.md
@@ -0,0 +1,91 @@
+# ENS Subgraph
+
+This Subgraph sources events from the ENS contracts. This includes the ENS registry, the Auction Registrar, and any resolvers that are created and linked to domains. The resolvers are added through dynamic data sources. More information on all of this can be found at [The Graph Documentation](https://thegraph.com/docs/developer/quick-start/).
+
+# Example Queries
+
+Here we have example queries, so that you don't have to type them in yourself eachtime in the graphiql playground:
+
+```graphql
+{
+ domains {
+ id
+ labelName
+ labelhash
+ parent {
+ id
+ }
+ subdomains {
+ id
+ }
+ owner {
+ id
+ }
+ resolver {
+ id
+ }
+ ttl
+ }
+ resolvers {
+ id
+ address
+ domain {
+ id
+ }
+ events {
+ id
+ node
+ ... on AddrChanged {
+ a
+ }
+ ... on NameChanged {
+ name
+ }
+ ... on AbiChanged {
+ contentType
+ }
+ ... on PubkeyChanged {
+ x
+ y
+ }
+ ... on TextChanged {
+ indexedKey
+ key
+ }
+ ... on ContenthashChanged {
+ hash
+ }
+ ... on InterfaceChanged {
+ interfaceID
+ implementer
+ }
+ ... on AuthorisationChanged {
+ owner
+ target
+ isAuthorized
+ }
+ }
+ }
+ registrations(where: { labelName_not: null }, orderBy: expiryDate, orderDirection: asc, first: 10, skip: 0) {
+ expiryDate
+ labelName
+ domain{
+ name
+ labelName
+ }
+ }
+}
+
+```
+
+# Build
+
+1/ yarn codegen
+2/ graph codegen && graph build
+
+# Authenticate in CLI
+graph auth --studio d2010a0f3e4eb8ccf9552d813066dcc1
+
+# Deploy Subgraph
+graph deploy --studio ens-sepolia
+
diff --git a/packages/ens-subgraph/abis/AuctionRegistrar.json b/packages/ens-subgraph/abis/AuctionRegistrar.json
new file mode 100644
index 000000000..e28b047b1
--- /dev/null
+++ b/packages/ens-subgraph/abis/AuctionRegistrar.json
@@ -0,0 +1,550 @@
+[
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "_hash",
+ "type": "bytes32"
+ }
+ ],
+ "name": "releaseDeed",
+ "outputs": [],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "name": "_hash",
+ "type": "bytes32"
+ }
+ ],
+ "name": "getAllowedTime",
+ "outputs": [
+ {
+ "name": "timestamp",
+ "type": "uint256"
+ }
+ ],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "unhashedName",
+ "type": "string"
+ }
+ ],
+ "name": "invalidateName",
+ "outputs": [],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "name": "hash",
+ "type": "bytes32"
+ },
+ {
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "name": "value",
+ "type": "uint256"
+ },
+ {
+ "name": "salt",
+ "type": "bytes32"
+ }
+ ],
+ "name": "shaBid",
+ "outputs": [
+ {
+ "name": "sealedBid",
+ "type": "bytes32"
+ }
+ ],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "bidder",
+ "type": "address"
+ },
+ {
+ "name": "seal",
+ "type": "bytes32"
+ }
+ ],
+ "name": "cancelBid",
+ "outputs": [],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "name": "_hash",
+ "type": "bytes32"
+ }
+ ],
+ "name": "entries",
+ "outputs": [
+ {
+ "name": "",
+ "type": "uint8"
+ },
+ {
+ "name": "",
+ "type": "address"
+ },
+ {
+ "name": "",
+ "type": "uint256"
+ },
+ {
+ "name": "",
+ "type": "uint256"
+ },
+ {
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [],
+ "name": "ens",
+ "outputs": [
+ {
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "_hash",
+ "type": "bytes32"
+ },
+ {
+ "name": "_value",
+ "type": "uint256"
+ },
+ {
+ "name": "_salt",
+ "type": "bytes32"
+ }
+ ],
+ "name": "unsealBid",
+ "outputs": [],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "_hash",
+ "type": "bytes32"
+ }
+ ],
+ "name": "transferRegistrars",
+ "outputs": [],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "name": "",
+ "type": "address"
+ },
+ {
+ "name": "",
+ "type": "bytes32"
+ }
+ ],
+ "name": "sealedBids",
+ "outputs": [
+ {
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "name": "_hash",
+ "type": "bytes32"
+ }
+ ],
+ "name": "state",
+ "outputs": [
+ {
+ "name": "",
+ "type": "uint8"
+ }
+ ],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "_hash",
+ "type": "bytes32"
+ },
+ {
+ "name": "newOwner",
+ "type": "address"
+ }
+ ],
+ "name": "transfer",
+ "outputs": [],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "name": "_hash",
+ "type": "bytes32"
+ },
+ {
+ "name": "_timestamp",
+ "type": "uint256"
+ }
+ ],
+ "name": "isAllowed",
+ "outputs": [
+ {
+ "name": "allowed",
+ "type": "bool"
+ }
+ ],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "_hash",
+ "type": "bytes32"
+ }
+ ],
+ "name": "finalizeAuction",
+ "outputs": [],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [],
+ "name": "registryStarted",
+ "outputs": [
+ {
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [],
+ "name": "launchLength",
+ "outputs": [
+ {
+ "name": "",
+ "type": "uint32"
+ }
+ ],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "sealedBid",
+ "type": "bytes32"
+ }
+ ],
+ "name": "newBid",
+ "outputs": [],
+ "payable": true,
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "labels",
+ "type": "bytes32[]"
+ }
+ ],
+ "name": "eraseNode",
+ "outputs": [],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "_hashes",
+ "type": "bytes32[]"
+ }
+ ],
+ "name": "startAuctions",
+ "outputs": [],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "hash",
+ "type": "bytes32"
+ },
+ {
+ "name": "deed",
+ "type": "address"
+ },
+ {
+ "name": "registrationDate",
+ "type": "uint256"
+ }
+ ],
+ "name": "acceptRegistrarTransfer",
+ "outputs": [],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "_hash",
+ "type": "bytes32"
+ }
+ ],
+ "name": "startAuction",
+ "outputs": [],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [],
+ "name": "rootNode",
+ "outputs": [
+ {
+ "name": "",
+ "type": "bytes32"
+ }
+ ],
+ "payable": false,
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "hashes",
+ "type": "bytes32[]"
+ },
+ {
+ "name": "sealedBid",
+ "type": "bytes32"
+ }
+ ],
+ "name": "startAuctionsAndBid",
+ "outputs": [],
+ "payable": true,
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "name": "_ens",
+ "type": "address"
+ },
+ {
+ "name": "_rootNode",
+ "type": "bytes32"
+ },
+ {
+ "name": "_startDate",
+ "type": "uint256"
+ }
+ ],
+ "payable": false,
+ "type": "constructor"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "name": "hash",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "name": "registrationDate",
+ "type": "uint256"
+ }
+ ],
+ "name": "AuctionStarted",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "name": "hash",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "name": "bidder",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "name": "deposit",
+ "type": "uint256"
+ }
+ ],
+ "name": "NewBid",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "name": "hash",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "name": "value",
+ "type": "uint256"
+ },
+ {
+ "indexed": false,
+ "name": "status",
+ "type": "uint8"
+ }
+ ],
+ "name": "BidRevealed",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "name": "hash",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "name": "value",
+ "type": "uint256"
+ },
+ {
+ "indexed": false,
+ "name": "registrationDate",
+ "type": "uint256"
+ }
+ ],
+ "name": "HashRegistered",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "name": "hash",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "name": "value",
+ "type": "uint256"
+ }
+ ],
+ "name": "HashReleased",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "name": "hash",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "name": "name",
+ "type": "string"
+ },
+ {
+ "indexed": false,
+ "name": "value",
+ "type": "uint256"
+ },
+ {
+ "indexed": false,
+ "name": "registrationDate",
+ "type": "uint256"
+ }
+ ],
+ "name": "HashInvalidated",
+ "type": "event"
+ }
+]
diff --git a/packages/ens-subgraph/abis/BaseRegistrar.json b/packages/ens-subgraph/abis/BaseRegistrar.json
new file mode 100644
index 000000000..56dba9ae8
--- /dev/null
+++ b/packages/ens-subgraph/abis/BaseRegistrar.json
@@ -0,0 +1 @@
+[{"constant":true,"inputs":[{"name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"owner","type":"address"}],"name":"reclaim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"ens","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"transferPeriodEnds","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"resolver","type":"address"}],"name":"setResolver","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MIGRATION_LOCK_PERIOD","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint256"}],"name":"available","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"controller","type":"address"}],"name":"addController","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"previousRegistrar","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"tokenId","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"GRACE_PERIOD","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"duration","type":"uint256"}],"name":"renew","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint256"}],"name":"nameExpires","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"controllers","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"baseNode","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"label","type":"bytes32"},{"name":"deed","type":"address"},{"name":"","type":"uint256"}],"name":"acceptRegistrarTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"controller","type":"address"}],"name":"removeController","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"owner","type":"address"},{"name":"duration","type":"uint256"}],"name":"register","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_ens","type":"address"},{"name":"_previousRegistrar","type":"address"},{"name":"_baseNode","type":"bytes32"},{"name":"_transferPeriodEnds","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"controller","type":"address"}],"name":"ControllerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"controller","type":"address"}],"name":"ControllerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":true,"name":"owner","type":"address"},{"indexed":false,"name":"expires","type":"uint256"}],"name":"NameMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":true,"name":"owner","type":"address"},{"indexed":false,"name":"expires","type":"uint256"}],"name":"NameRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"expires","type":"uint256"}],"name":"NameRenewed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":true,"name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"approved","type":"address"},{"indexed":true,"name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"operator","type":"address"},{"indexed":false,"name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"}]
diff --git a/packages/ens-subgraph/abis/Deed.json b/packages/ens-subgraph/abis/Deed.json
new file mode 100644
index 000000000..b95eb1ef5
--- /dev/null
+++ b/packages/ens-subgraph/abis/Deed.json
@@ -0,0 +1 @@
+[{"constant":true,"inputs":[],"name":"creationDate","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"destroyDeed","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"registrar","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"value","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"previousOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newValue","type":"uint256"},{"name":"throwOnFailure","type":"bool"}],"name":"setBalance","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"refundRatio","type":"uint256"}],"name":"closeDeed","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newRegistrar","type":"address"}],"name":"setRegistrar","outputs":[],"payable":false,"type":"function"},{"inputs":[{"name":"_owner","type":"address"}],"payable":true,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[],"name":"DeedClosed","type":"event"}]
diff --git a/packages/ens-subgraph/abis/EthRegistrarController.json b/packages/ens-subgraph/abis/EthRegistrarController.json
new file mode 100644
index 000000000..9e41bed0b
--- /dev/null
+++ b/packages/ens-subgraph/abis/EthRegistrarController.json
@@ -0,0 +1,592 @@
+[
+ {
+ "inputs": [
+ {
+ "internalType": "contract BaseRegistrarImplementation",
+ "name": "_base",
+ "type": "address"
+ },
+ {
+ "internalType": "contract IPriceOracle",
+ "name": "_prices",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "_minCommitmentAge",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "_maxCommitmentAge",
+ "type": "uint256"
+ },
+ {
+ "internalType": "contract ReverseRegistrar",
+ "name": "_reverseRegistrar",
+ "type": "address"
+ },
+ {
+ "internalType": "contract INameWrapper",
+ "name": "_nameWrapper",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "constructor"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "commitment",
+ "type": "bytes32"
+ }
+ ],
+ "name": "CommitmentTooNew",
+ "type": "error"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "commitment",
+ "type": "bytes32"
+ }
+ ],
+ "name": "CommitmentTooOld",
+ "type": "error"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "duration",
+ "type": "uint256"
+ }
+ ],
+ "name": "DurationTooShort",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "InsufficientValue",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "MaxCommitmentAgeTooHigh",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "MaxCommitmentAgeTooLow",
+ "type": "error"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
+ }
+ ],
+ "name": "NameNotAvailable",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "ResolverRequiredWhenDataSupplied",
+ "type": "error"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "commitment",
+ "type": "bytes32"
+ }
+ ],
+ "name": "UnexpiredCommitmentExists",
+ "type": "error"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": false,
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
+ },
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "label",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "baseCost",
+ "type": "uint256"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "premium",
+ "type": "uint256"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "expires",
+ "type": "uint256"
+ }
+ ],
+ "name": "NameRegistered",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": false,
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
+ },
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "label",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "cost",
+ "type": "uint256"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "expires",
+ "type": "uint256"
+ }
+ ],
+ "name": "NameRenewed",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "previousOwner",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "newOwner",
+ "type": "address"
+ }
+ ],
+ "name": "OwnershipTransferred",
+ "type": "event"
+ },
+ {
+ "inputs": [],
+ "name": "MIN_REGISTRATION_DURATION",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
+ }
+ ],
+ "name": "available",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "commitment",
+ "type": "bytes32"
+ }
+ ],
+ "name": "commit",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "",
+ "type": "bytes32"
+ }
+ ],
+ "name": "commitments",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
+ },
+ {
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "duration",
+ "type": "uint256"
+ },
+ {
+ "internalType": "bytes32",
+ "name": "secret",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "resolver",
+ "type": "address"
+ },
+ {
+ "internalType": "bytes[]",
+ "name": "data",
+ "type": "bytes[]"
+ },
+ {
+ "internalType": "bool",
+ "name": "reverseRecord",
+ "type": "bool"
+ },
+ {
+ "internalType": "uint16",
+ "name": "ownerControlledFuses",
+ "type": "uint16"
+ }
+ ],
+ "name": "makeCommitment",
+ "outputs": [
+ {
+ "internalType": "bytes32",
+ "name": "",
+ "type": "bytes32"
+ }
+ ],
+ "stateMutability": "pure",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "maxCommitmentAge",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "minCommitmentAge",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "nameWrapper",
+ "outputs": [
+ {
+ "internalType": "contract INameWrapper",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "owner",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "prices",
+ "outputs": [
+ {
+ "internalType": "contract IPriceOracle",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "_token",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "_to",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "_amount",
+ "type": "uint256"
+ }
+ ],
+ "name": "recoverFunds",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
+ },
+ {
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "duration",
+ "type": "uint256"
+ },
+ {
+ "internalType": "bytes32",
+ "name": "secret",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "resolver",
+ "type": "address"
+ },
+ {
+ "internalType": "bytes[]",
+ "name": "data",
+ "type": "bytes[]"
+ },
+ {
+ "internalType": "bool",
+ "name": "reverseRecord",
+ "type": "bool"
+ },
+ {
+ "internalType": "uint16",
+ "name": "ownerControlledFuses",
+ "type": "uint16"
+ }
+ ],
+ "name": "register",
+ "outputs": [],
+ "stateMutability": "payable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
+ },
+ {
+ "internalType": "uint256",
+ "name": "duration",
+ "type": "uint256"
+ }
+ ],
+ "name": "renew",
+ "outputs": [],
+ "stateMutability": "payable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "renounceOwnership",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
+ },
+ {
+ "internalType": "uint256",
+ "name": "duration",
+ "type": "uint256"
+ }
+ ],
+ "name": "rentPrice",
+ "outputs": [
+ {
+ "components": [
+ {
+ "internalType": "uint256",
+ "name": "base",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "premium",
+ "type": "uint256"
+ }
+ ],
+ "internalType": "struct IPriceOracle.Price",
+ "name": "price",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "reverseRegistrar",
+ "outputs": [
+ {
+ "internalType": "contract ReverseRegistrar",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes4",
+ "name": "interfaceID",
+ "type": "bytes4"
+ }
+ ],
+ "name": "supportsInterface",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "pure",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "newOwner",
+ "type": "address"
+ }
+ ],
+ "name": "transferOwnership",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
+ }
+ ],
+ "name": "valid",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "pure",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "withdraw",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ }
+]
diff --git a/packages/ens-subgraph/abis/EthRegistrarControllerOld.json b/packages/ens-subgraph/abis/EthRegistrarControllerOld.json
new file mode 100644
index 000000000..dec1c868d
--- /dev/null
+++ b/packages/ens-subgraph/abis/EthRegistrarControllerOld.json
@@ -0,0 +1 @@
+[{"constant":true,"inputs":[{"name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_prices","type":"address"}],"name":"setPriceOracle","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_minCommitmentAge","type":"uint256"},{"name":"_maxCommitmentAge","type":"uint256"}],"name":"setCommitmentAges","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"commitments","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"name","type":"string"},{"name":"duration","type":"uint256"}],"name":"rentPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"owner","type":"address"},{"name":"duration","type":"uint256"},{"name":"secret","type":"bytes32"}],"name":"register","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"MIN_REGISTRATION_DURATION","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minCommitmentAge","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"name","type":"string"}],"name":"valid","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"duration","type":"uint256"}],"name":"renew","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"name","type":"string"}],"name":"available","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxCommitmentAge","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"commitment","type":"bytes32"}],"name":"commit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"name","type":"string"},{"name":"owner","type":"address"},{"name":"secret","type":"bytes32"}],"name":"makeCommitment","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"pure","type":"function"},{"inputs":[{"name":"_base","type":"address"},{"name":"_prices","type":"address"},{"name":"_minCommitmentAge","type":"uint256"},{"name":"_maxCommitmentAge","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"name","type":"string"},{"indexed":true,"name":"label","type":"bytes32"},{"indexed":true,"name":"owner","type":"address"},{"indexed":false,"name":"cost","type":"uint256"},{"indexed":false,"name":"expires","type":"uint256"}],"name":"NameRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"name","type":"string"},{"indexed":true,"name":"label","type":"bytes32"},{"indexed":false,"name":"cost","type":"uint256"},{"indexed":false,"name":"expires","type":"uint256"}],"name":"NameRenewed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"oracle","type":"address"}],"name":"NewPriceOracle","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]
diff --git a/packages/ens-subgraph/abis/NameWrapper.json b/packages/ens-subgraph/abis/NameWrapper.json
new file mode 100644
index 000000000..da09743cb
--- /dev/null
+++ b/packages/ens-subgraph/abis/NameWrapper.json
@@ -0,0 +1,1372 @@
+[
+ {
+ "inputs": [
+ {
+ "internalType": "contract ENS",
+ "name": "_ens",
+ "type": "address"
+ },
+ {
+ "internalType": "contract IBaseRegistrar",
+ "name": "_registrar",
+ "type": "address"
+ },
+ {
+ "internalType": "contract IMetadataService",
+ "name": "_metadataService",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "constructor"
+ },
+ {
+ "inputs": [],
+ "name": "CannotUpgrade",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "IncompatibleParent",
+ "type": "error"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ }
+ ],
+ "name": "IncorrectTargetOwner",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "IncorrectTokenType",
+ "type": "error"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "labelHash",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "bytes32",
+ "name": "expectedLabelhash",
+ "type": "bytes32"
+ }
+ ],
+ "name": "LabelMismatch",
+ "type": "error"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "string",
+ "name": "label",
+ "type": "string"
+ }
+ ],
+ "name": "LabelTooLong",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "LabelTooShort",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "NameIsNotWrapped",
+ "type": "error"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ }
+ ],
+ "name": "OperationProhibited",
+ "type": "error"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "addr",
+ "type": "address"
+ }
+ ],
+ "name": "Unauthorised",
+ "type": "error"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "account",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "operator",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "bool",
+ "name": "approved",
+ "type": "bool"
+ }
+ ],
+ "name": "ApprovalForAll",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "controller",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "bool",
+ "name": "active",
+ "type": "bool"
+ }
+ ],
+ "name": "ControllerChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint64",
+ "name": "expiry",
+ "type": "uint64"
+ }
+ ],
+ "name": "ExpiryExtended",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint32",
+ "name": "fuses",
+ "type": "uint32"
+ }
+ ],
+ "name": "FusesSet",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ }
+ ],
+ "name": "NameUnwrapped",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "internalType": "bytes",
+ "name": "name",
+ "type": "bytes"
+ },
+ {
+ "indexed": false,
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint32",
+ "name": "fuses",
+ "type": "uint32"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint64",
+ "name": "expiry",
+ "type": "uint64"
+ }
+ ],
+ "name": "NameWrapped",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "previousOwner",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "newOwner",
+ "type": "address"
+ }
+ ],
+ "name": "OwnershipTransferred",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "operator",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "from",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "to",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256[]",
+ "name": "ids",
+ "type": "uint256[]"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256[]",
+ "name": "values",
+ "type": "uint256[]"
+ }
+ ],
+ "name": "TransferBatch",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "operator",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "from",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "to",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "id",
+ "type": "uint256"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "value",
+ "type": "uint256"
+ }
+ ],
+ "name": "TransferSingle",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": false,
+ "internalType": "string",
+ "name": "value",
+ "type": "string"
+ },
+ {
+ "indexed": true,
+ "internalType": "uint256",
+ "name": "id",
+ "type": "uint256"
+ }
+ ],
+ "name": "URI",
+ "type": "event"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "name": "_tokens",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "uint32",
+ "name": "fuseMask",
+ "type": "uint32"
+ }
+ ],
+ "name": "allFusesBurned",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "account",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "id",
+ "type": "uint256"
+ }
+ ],
+ "name": "balanceOf",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address[]",
+ "name": "accounts",
+ "type": "address[]"
+ },
+ {
+ "internalType": "uint256[]",
+ "name": "ids",
+ "type": "uint256[]"
+ }
+ ],
+ "name": "balanceOfBatch",
+ "outputs": [
+ {
+ "internalType": "uint256[]",
+ "name": "",
+ "type": "uint256[]"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "addr",
+ "type": "address"
+ }
+ ],
+ "name": "canModifyName",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "name": "controllers",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "ens",
+ "outputs": [
+ {
+ "internalType": "contract ENS",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "parentNode",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "bytes32",
+ "name": "labelhash",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "uint64",
+ "name": "expiry",
+ "type": "uint64"
+ }
+ ],
+ "name": "extendExpiry",
+ "outputs": [
+ {
+ "internalType": "uint64",
+ "name": "",
+ "type": "uint64"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "id",
+ "type": "uint256"
+ }
+ ],
+ "name": "getData",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "internalType": "uint32",
+ "name": "fuses",
+ "type": "uint32"
+ },
+ {
+ "internalType": "uint64",
+ "name": "expiry",
+ "type": "uint64"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "account",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "operator",
+ "type": "address"
+ }
+ ],
+ "name": "isApprovedForAll",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ }
+ ],
+ "name": "isWrapped",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "metadataService",
+ "outputs": [
+ {
+ "internalType": "contract IMetadataService",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "name",
+ "outputs": [
+ {
+ "internalType": "string",
+ "name": "",
+ "type": "string"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "",
+ "type": "bytes32"
+ }
+ ],
+ "name": "names",
+ "outputs": [
+ {
+ "internalType": "bytes",
+ "name": "",
+ "type": "bytes"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "to",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "tokenId",
+ "type": "uint256"
+ },
+ {
+ "internalType": "bytes",
+ "name": "data",
+ "type": "bytes"
+ }
+ ],
+ "name": "onERC721Received",
+ "outputs": [
+ {
+ "internalType": "bytes4",
+ "name": "",
+ "type": "bytes4"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "owner",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "id",
+ "type": "uint256"
+ }
+ ],
+ "name": "ownerOf",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "_token",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "_to",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "_amount",
+ "type": "uint256"
+ }
+ ],
+ "name": "recoverFunds",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "string",
+ "name": "label",
+ "type": "string"
+ },
+ {
+ "internalType": "address",
+ "name": "wrappedOwner",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "duration",
+ "type": "uint256"
+ },
+ {
+ "internalType": "address",
+ "name": "resolver",
+ "type": "address"
+ },
+ {
+ "internalType": "uint16",
+ "name": "ownerControlledFuses",
+ "type": "uint16"
+ }
+ ],
+ "name": "registerAndWrapETH2LD",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "registrarExpiry",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "registrar",
+ "outputs": [
+ {
+ "internalType": "contract IBaseRegistrar",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "tokenId",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "duration",
+ "type": "uint256"
+ }
+ ],
+ "name": "renew",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "expires",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "renounceOwnership",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "from",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "to",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256[]",
+ "name": "ids",
+ "type": "uint256[]"
+ },
+ {
+ "internalType": "uint256[]",
+ "name": "amounts",
+ "type": "uint256[]"
+ },
+ {
+ "internalType": "bytes",
+ "name": "data",
+ "type": "bytes"
+ }
+ ],
+ "name": "safeBatchTransferFrom",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "from",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "to",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "id",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "amount",
+ "type": "uint256"
+ },
+ {
+ "internalType": "bytes",
+ "name": "data",
+ "type": "bytes"
+ }
+ ],
+ "name": "safeTransferFrom",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "operator",
+ "type": "address"
+ },
+ {
+ "internalType": "bool",
+ "name": "approved",
+ "type": "bool"
+ }
+ ],
+ "name": "setApprovalForAll",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "parentNode",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "bytes32",
+ "name": "labelhash",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "uint32",
+ "name": "fuses",
+ "type": "uint32"
+ },
+ {
+ "internalType": "uint64",
+ "name": "expiry",
+ "type": "uint64"
+ }
+ ],
+ "name": "setChildFuses",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "controller",
+ "type": "address"
+ },
+ {
+ "internalType": "bool",
+ "name": "active",
+ "type": "bool"
+ }
+ ],
+ "name": "setController",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "uint16",
+ "name": "ownerControlledFuses",
+ "type": "uint16"
+ }
+ ],
+ "name": "setFuses",
+ "outputs": [
+ {
+ "internalType": "uint32",
+ "name": "",
+ "type": "uint32"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "contract IMetadataService",
+ "name": "_metadataService",
+ "type": "address"
+ }
+ ],
+ "name": "setMetadataService",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "resolver",
+ "type": "address"
+ },
+ {
+ "internalType": "uint64",
+ "name": "ttl",
+ "type": "uint64"
+ }
+ ],
+ "name": "setRecord",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "resolver",
+ "type": "address"
+ }
+ ],
+ "name": "setResolver",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "parentNode",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "string",
+ "name": "label",
+ "type": "string"
+ },
+ {
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "internalType": "uint32",
+ "name": "fuses",
+ "type": "uint32"
+ },
+ {
+ "internalType": "uint64",
+ "name": "expiry",
+ "type": "uint64"
+ }
+ ],
+ "name": "setSubnodeOwner",
+ "outputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "parentNode",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "string",
+ "name": "label",
+ "type": "string"
+ },
+ {
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "resolver",
+ "type": "address"
+ },
+ {
+ "internalType": "uint64",
+ "name": "ttl",
+ "type": "uint64"
+ },
+ {
+ "internalType": "uint32",
+ "name": "fuses",
+ "type": "uint32"
+ },
+ {
+ "internalType": "uint64",
+ "name": "expiry",
+ "type": "uint64"
+ }
+ ],
+ "name": "setSubnodeRecord",
+ "outputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "uint64",
+ "name": "ttl",
+ "type": "uint64"
+ }
+ ],
+ "name": "setTTL",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "contract INameWrapperUpgrade",
+ "name": "_upgradeAddress",
+ "type": "address"
+ }
+ ],
+ "name": "setUpgradeContract",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes4",
+ "name": "interfaceId",
+ "type": "bytes4"
+ }
+ ],
+ "name": "supportsInterface",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "newOwner",
+ "type": "address"
+ }
+ ],
+ "name": "transferOwnership",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "parentNode",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "bytes32",
+ "name": "labelhash",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "controller",
+ "type": "address"
+ }
+ ],
+ "name": "unwrap",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "labelhash",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "registrant",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "controller",
+ "type": "address"
+ }
+ ],
+ "name": "unwrapETH2LD",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "parentNode",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "string",
+ "name": "label",
+ "type": "string"
+ },
+ {
+ "internalType": "address",
+ "name": "wrappedOwner",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "resolver",
+ "type": "address"
+ }
+ ],
+ "name": "upgrade",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "upgradeContract",
+ "outputs": [
+ {
+ "internalType": "contract INameWrapperUpgrade",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "string",
+ "name": "label",
+ "type": "string"
+ },
+ {
+ "internalType": "address",
+ "name": "wrappedOwner",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "resolver",
+ "type": "address"
+ }
+ ],
+ "name": "upgradeETH2LD",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "tokenId",
+ "type": "uint256"
+ }
+ ],
+ "name": "uri",
+ "outputs": [
+ {
+ "internalType": "string",
+ "name": "",
+ "type": "string"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes",
+ "name": "name",
+ "type": "bytes"
+ },
+ {
+ "internalType": "address",
+ "name": "wrappedOwner",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "resolver",
+ "type": "address"
+ }
+ ],
+ "name": "wrap",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "string",
+ "name": "label",
+ "type": "string"
+ },
+ {
+ "internalType": "address",
+ "name": "wrappedOwner",
+ "type": "address"
+ },
+ {
+ "internalType": "uint16",
+ "name": "ownerControlledFuses",
+ "type": "uint16"
+ },
+ {
+ "internalType": "address",
+ "name": "resolver",
+ "type": "address"
+ }
+ ],
+ "name": "wrapETH2LD",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ }
+]
diff --git a/packages/ens-subgraph/abis/PublicResolver.json b/packages/ens-subgraph/abis/PublicResolver.json
new file mode 100644
index 000000000..fa5de86fa
--- /dev/null
+++ b/packages/ens-subgraph/abis/PublicResolver.json
@@ -0,0 +1,731 @@
+[
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "internalType": "bytes4",
+ "name": "interfaceID",
+ "type": "bytes4"
+ }
+ ],
+ "name": "supportsInterface",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "pure",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "string",
+ "name": "key",
+ "type": "string"
+ },
+ {
+ "internalType": "string",
+ "name": "value",
+ "type": "string"
+ }
+ ],
+ "name": "setText",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "bytes4",
+ "name": "interfaceID",
+ "type": "bytes4"
+ }
+ ],
+ "name": "interfaceImplementer",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "uint256",
+ "name": "contentTypes",
+ "type": "uint256"
+ }
+ ],
+ "name": "ABI",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ },
+ {
+ "internalType": "bytes",
+ "name": "",
+ "type": "bytes"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "bytes32",
+ "name": "x",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "bytes32",
+ "name": "y",
+ "type": "bytes32"
+ }
+ ],
+ "name": "setPubkey",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "bytes",
+ "name": "hash",
+ "type": "bytes"
+ }
+ ],
+ "name": "setContenthash",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ }
+ ],
+ "name": "addr",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "target",
+ "type": "address"
+ },
+ {
+ "internalType": "bool",
+ "name": "isAuthorised",
+ "type": "bool"
+ }
+ ],
+ "name": "setAuthorisation",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "string",
+ "name": "key",
+ "type": "string"
+ }
+ ],
+ "name": "text",
+ "outputs": [
+ {
+ "internalType": "string",
+ "name": "",
+ "type": "string"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "uint256",
+ "name": "contentType",
+ "type": "uint256"
+ },
+ {
+ "internalType": "bytes",
+ "name": "data",
+ "type": "bytes"
+ }
+ ],
+ "name": "setABI",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ }
+ ],
+ "name": "name",
+ "outputs": [
+ {
+ "internalType": "string",
+ "name": "",
+ "type": "string"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
+ }
+ ],
+ "name": "setName",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "uint256",
+ "name": "coinType",
+ "type": "uint256"
+ },
+ {
+ "internalType": "bytes",
+ "name": "a",
+ "type": "bytes"
+ }
+ ],
+ "name": "setAddr",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ }
+ ],
+ "name": "contenthash",
+ "outputs": [
+ {
+ "internalType": "bytes",
+ "name": "",
+ "type": "bytes"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ }
+ ],
+ "name": "pubkey",
+ "outputs": [
+ {
+ "internalType": "bytes32",
+ "name": "x",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "bytes32",
+ "name": "y",
+ "type": "bytes32"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "a",
+ "type": "address"
+ }
+ ],
+ "name": "setAddr",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "bytes4",
+ "name": "interfaceID",
+ "type": "bytes4"
+ },
+ {
+ "internalType": "address",
+ "name": "implementer",
+ "type": "address"
+ }
+ ],
+ "name": "setInterface",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "uint256",
+ "name": "coinType",
+ "type": "uint256"
+ }
+ ],
+ "name": "addr",
+ "outputs": [
+ {
+ "internalType": "bytes",
+ "name": "",
+ "type": "bytes"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "name": "authorisations",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "contract ENS",
+ "name": "_ens",
+ "type": "address"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "constructor"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "target",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "bool",
+ "name": "isAuthorised",
+ "type": "bool"
+ }
+ ],
+ "name": "AuthorisationChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "internalType": "string",
+ "name": "indexedKey",
+ "type": "string"
+ },
+ {
+ "indexed": false,
+ "internalType": "string",
+ "name": "key",
+ "type": "string"
+ }
+ ],
+ "name": "TextChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "internalType": "string",
+ "name": "indexedKey",
+ "type": "string"
+ },
+ {
+ "indexed": false,
+ "internalType": "string",
+ "name": "key",
+ "type": "string"
+ },
+ {
+ "indexed": false,
+ "internalType": "string",
+ "name": "value",
+ "type": "string"
+ }
+ ],
+ "name": "TextChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "internalType": "bytes32",
+ "name": "x",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "internalType": "bytes32",
+ "name": "y",
+ "type": "bytes32"
+ }
+ ],
+ "name": "PubkeyChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "internalType": "string",
+ "name": "name",
+ "type": "string"
+ }
+ ],
+ "name": "NameChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "internalType": "bytes4",
+ "name": "interfaceID",
+ "type": "bytes4"
+ },
+ {
+ "indexed": false,
+ "internalType": "address",
+ "name": "implementer",
+ "type": "address"
+ }
+ ],
+ "name": "InterfaceChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "internalType": "bytes",
+ "name": "hash",
+ "type": "bytes"
+ }
+ ],
+ "name": "ContenthashChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "internalType": "address",
+ "name": "a",
+ "type": "address"
+ }
+ ],
+ "name": "AddrChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "coinType",
+ "type": "uint256"
+ },
+ {
+ "indexed": false,
+ "internalType": "bytes",
+ "name": "newAddress",
+ "type": "bytes"
+ }
+ ],
+ "name": "AddressChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "internalType": "uint256",
+ "name": "contentType",
+ "type": "uint256"
+ }
+ ],
+ "name": "ABIChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "node",
+ "type": "bytes32"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint64",
+ "name": "newVersion",
+ "type": "uint64"
+ }
+ ],
+ "name": "VersionChanged",
+ "type": "event"
+ }
+]
diff --git a/packages/ens-subgraph/abis/Registry.json b/packages/ens-subgraph/abis/Registry.json
new file mode 100644
index 000000000..5122816ce
--- /dev/null
+++ b/packages/ens-subgraph/abis/Registry.json
@@ -0,0 +1,209 @@
+[
+ {
+ "constant":true,
+ "inputs":[
+ {
+ "name":"node",
+ "type":"bytes32"
+ }
+ ],
+ "name":"resolver",
+ "outputs":[
+ {
+ "name":"",
+ "type":"address"
+ }
+ ],
+ "payable":false,
+ "type":"function"
+ },
+ {
+ "constant":true,
+ "inputs":[
+ {
+ "name":"node",
+ "type":"bytes32"
+ }
+ ],
+ "name":"owner",
+ "outputs":[
+ {
+ "name":"",
+ "type":"address"
+ }
+ ],
+ "payable":false,
+ "type":"function"
+ },
+ {
+ "constant":false,
+ "inputs":[
+ {
+ "name":"node",
+ "type":"bytes32"
+ },
+ {
+ "name":"label",
+ "type":"bytes32"
+ },
+ {
+ "name":"owner",
+ "type":"address"
+ }
+ ],
+ "name":"setSubnodeOwner",
+ "outputs":[
+
+ ],
+ "payable":false,
+ "type":"function"
+ },
+ {
+ "constant":false,
+ "inputs":[
+ {
+ "name":"node",
+ "type":"bytes32"
+ },
+ {
+ "name":"ttl",
+ "type":"uint64"
+ }
+ ],
+ "name":"setTTL",
+ "outputs":[
+
+ ],
+ "payable":false,
+ "type":"function"
+ },
+ {
+ "constant":true,
+ "inputs":[
+ {
+ "name":"node",
+ "type":"bytes32"
+ }
+ ],
+ "name":"ttl",
+ "outputs":[
+ {
+ "name":"",
+ "type":"uint64"
+ }
+ ],
+ "payable":false,
+ "type":"function"
+ },
+ {
+ "constant":false,
+ "inputs":[
+ {
+ "name":"node",
+ "type":"bytes32"
+ },
+ {
+ "name":"resolver",
+ "type":"address"
+ }
+ ],
+ "name":"setResolver",
+ "outputs":[
+
+ ],
+ "payable":false,
+ "type":"function"
+ },
+ {
+ "constant":false,
+ "inputs":[
+ {
+ "name":"node",
+ "type":"bytes32"
+ },
+ {
+ "name":"owner",
+ "type":"address"
+ }
+ ],
+ "name":"setOwner",
+ "outputs":[
+
+ ],
+ "payable":false,
+ "type":"function"
+ },
+ {
+ "anonymous":false,
+ "inputs":[
+ {
+ "indexed":true,
+ "name":"node",
+ "type":"bytes32"
+ },
+ {
+ "indexed":false,
+ "name":"owner",
+ "type":"address"
+ }
+ ],
+ "name":"Transfer",
+ "type":"event"
+ },
+ {
+ "anonymous":false,
+ "inputs":[
+ {
+ "indexed":true,
+ "name":"node",
+ "type":"bytes32"
+ },
+ {
+ "indexed":true,
+ "name":"label",
+ "type":"bytes32"
+ },
+ {
+ "indexed":false,
+ "name":"owner",
+ "type":"address"
+ }
+ ],
+ "name":"NewOwner",
+ "type":"event"
+ },
+ {
+ "anonymous":false,
+ "inputs":[
+ {
+ "indexed":true,
+ "name":"node",
+ "type":"bytes32"
+ },
+ {
+ "indexed":false,
+ "name":"resolver",
+ "type":"address"
+ }
+ ],
+ "name":"NewResolver",
+ "type":"event"
+ },
+ {
+ "anonymous":false,
+ "inputs":[
+ {
+ "indexed":true,
+ "name":"node",
+ "type":"bytes32"
+ },
+ {
+ "indexed":false,
+ "name":"ttl",
+ "type":"uint64"
+ }
+ ],
+ "name":"NewTTL",
+ "type":"event"
+ }
+]
\ No newline at end of file
diff --git a/packages/ens-subgraph/networks.json b/packages/ens-subgraph/networks.json
new file mode 100644
index 000000000..fa2381f70
--- /dev/null
+++ b/packages/ens-subgraph/networks.json
@@ -0,0 +1,119 @@
+{
+ "mainnet": {
+ "ENSRegistry": {
+ "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
+ "startBlock": 9380380
+ },
+ "ENSRegistryOld": {
+ "address": "0x314159265dd8dbb310642f98f50c066173c1259b",
+ "startBlock": 3327417
+ },
+ "Resolver": {
+ "startBlock": 3327417
+ },
+ "BaseRegistrar": {
+ "address": "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
+ "startBlock": 9380410
+ },
+ "EthRegistrarControllerOld": {
+ "address": "0x283Af0B28c62C092C9727F1Ee09c02CA627EB7F5",
+ "startBlock": 9380471
+ },
+ "EthRegistrarController": {
+ "address": "0x253553366Da8546fC250F225fe3d25d0C782303b",
+ "startBlock": 16925618
+ },
+ "NameWrapper": {
+ "address": "0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401",
+ "startBlock": 16925608
+ }
+ },
+ "goerli": {
+ "ENSRegistry": {
+ "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
+ "startBlock": 2086611
+ },
+ "ENSRegistryOld": {
+ "address": "0x112234455c3a32fd11230c42e7bccd4a84e02010",
+ "startBlock": 43152
+ },
+ "Resolver": {
+ "startBlock": 43152
+ },
+ "BaseRegistrar": {
+ "address": "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
+ "startBlock": 2086621
+ },
+ "EthRegistrarControllerOld": {
+ "address": "0x283Af0B28c62C092C9727F1Ee09c02CA627EB7F5",
+ "startBlock": 2086640
+ },
+ "EthRegistrarController": {
+ "address": "0xCc5e7dB10E65EED1BBD105359e7268aa660f6734",
+ "startBlock": 8649286
+ },
+ "NameWrapper": {
+ "address": "0x114D4603199df73e7D157787f8778E21fCd13066",
+ "startBlock": 8649122
+ }
+ },
+ "sepolia": {
+ "ENSRegistry": {
+ "address": "0x9125C4f492Ca725A2EAE5d9Df5643F6f41Fe77BE",
+ "startBlock": 5570702
+ },
+ "ENSRegistryOld": {
+ "address": "0x529a47F9d92375Ea637b56e64C7eaec266B4A575",
+ "startBlock": 5570741
+ },
+ "Resolver": {
+ "address": "0x7161c2eEf390ef14053E13012D6E761938820127",
+ "startBlock": 5570761
+ },
+ "BaseRegistrar": {
+ "address": "0x0d5446e2050DCDc373DbB13A2e6a81D89E85FEb6",
+ "startBlock": 5570704
+ },
+ "EthRegistrarControllerOld": {
+ "address": "0x34823AD0432e7BDB512556093A369539fd3cCb39",
+ "startBlock": 5570748
+ },
+ "EthRegistrarController": {
+ "address": "0xE2f076220c4e456A10398A8482d84BE1E8b82516",
+ "startBlock": 5570752
+ },
+ "NameWrapper": {
+ "address": "0x0Fb19ba94805a816471C84c90F167285bA888FD3",
+ "startBlock": 5570741
+ }
+ },
+ "holesky": {
+ "ENSRegistry": {
+ "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
+ "startBlock": 801613
+ },
+ "ENSRegistryOld": {
+ "address": "0x94f523b8261B815b87EFfCf4d18E6aBeF18d6e4b",
+ "startBlock": 801536
+ },
+ "Resolver": {
+ "startBlock": 801536
+ },
+ "BaseRegistrar": {
+ "address": "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
+ "startBlock": 801686
+ },
+ "EthRegistrarControllerOld": {
+ "address": "0xf13fC748601fDc5afA255e9D9166EB43f603a903",
+ "startBlock": 815355
+ },
+ "EthRegistrarController": {
+ "address": "0x179Be112b24Ad4cFC392eF8924DfA08C20Ad8583",
+ "startBlock": 815359
+ },
+ "NameWrapper": {
+ "address": "0xab50971078225D365994dc1Edcb9b7FD72Bb4862",
+ "startBlock": 815127
+ }
+ }
+}
diff --git a/packages/ens-subgraph/package.json b/packages/ens-subgraph/package.json
new file mode 100644
index 000000000..a0e78bbe5
--- /dev/null
+++ b/packages/ens-subgraph/package.json
@@ -0,0 +1,32 @@
+{
+ "name": "ens-subgraph",
+ "version": "1.0.2",
+ "repository": "https://github.com/ensdomains/ens-subgraph",
+ "license": "MIT",
+ "scripts": {
+ "codegen": "graph codegen --output-dir src/types/",
+ "test": "graph test",
+ "setup": "yarn codegen && yarn create-local && yarn deploy-local",
+ "create-local": "graph create graphprotocol/ens --node http://127.0.0.1:8020",
+ "deploy-local": "graph deploy graphprotocol/ens --ipfs http://localhost:5001 --node http://127.0.0.1:8020/ --version-label 0.0.1",
+ "remove-local": "graph remove graphprotocol/ens --node http://127.0.0.1:8020",
+ "docker:setup": "yarn codegen && yarn docker:create-local && yarn docker:deploy-local",
+ "docker:create-local": "graph create graphprotocol/ens --node http://ens-app_graph-node_1:8020",
+ "docker:deploy-local": "graph deploy graphprotocol/ens --ipfs http://ens-app_ipfs_1:5001 --node http://ens-app_graph-node_1:8020/ --version-label 0.0.1",
+ "docker:remove-local": "graph remove graphprotocol/ens --node http://ens-app_graph-node_1:8020",
+ "build": "graph build",
+ "deploy": "graph deploy --network mainnet --product hosted-service ensdomains/ens",
+ "deploy:goerli": "graph deploy --network goerli --product hosted-service ensdomains/ensgoerli",
+ "deploy:sepolia": "graph deploy --network sepolia --studio enssepolia",
+ "deploy:holesky": "graph deploy --network holesky --studio ensholesky",
+ "watch-local": "graph deploy graphprotocol/ens --watch --debug --node http://127.0.0.1:8020/ --ipfs http://localhost:5001"
+ },
+ "devDependencies": {
+ "@ensdomains/content-hash": "^2.5.3",
+ "@graphprotocol/graph-cli": "^0.67.2",
+ "@graphprotocol/graph-ts": "^0.31.0",
+ "assemblyscript": "^0.19.0",
+ "matchstick-as": "^0.5.2",
+ "typescript": "^4.9.4"
+ }
+}
diff --git a/packages/ens-subgraph/schema.graphql b/packages/ens-subgraph/schema.graphql
new file mode 100644
index 000000000..90268cfc1
--- /dev/null
+++ b/packages/ens-subgraph/schema.graphql
@@ -0,0 +1,451 @@
+type Domain @entity {
+ "The namehash of the name"
+ id: ID!
+ "The human readable name, if known. Unknown portions replaced with hash in square brackets (eg, foo.[1234].eth)"
+ name: String
+ "The human readable label name (imported from CSV), if known"
+ labelName: String
+ "keccak256(labelName)"
+ labelhash: Bytes
+ "The namehash (id) of the parent name"
+ parent: Domain
+ "Can count domains from length of array"
+ subdomains: [Domain!]! @derivedFrom(field: "parent")
+ "The number of subdomains"
+ subdomainCount: Int!
+ "Address logged from current resolver, if any"
+ resolvedAddress: Account
+
+ "The resolver that controls the domain's settings"
+ resolver: Resolver
+ "The time-to-live (TTL) value of the domain's records"
+ ttl: BigInt
+
+ "Indicates whether the domain has been migrated to a new registrar"
+ isMigrated: Boolean!
+ "The time when the domain was created"
+ createdAt: BigInt!
+
+ "The account that owns the domain"
+ owner: Account!
+ "The account that owns the ERC721 NFT for the domain"
+ registrant: Account
+ "The account that owns the wrapped domain"
+ wrappedOwner: Account
+
+ "The expiry date for the domain, from either the registration, or the wrapped domain if PCC is burned"
+ expiryDate: BigInt
+
+ "The registration associated with the domain"
+ registration: Registration @derivedFrom(field: "domain")
+ "The wrapped domain associated with the domain"
+ wrappedDomain: WrappedDomain @derivedFrom(field: "domain")
+
+ "The events associated with the domain"
+ events: [DomainEvent!]! @derivedFrom(field: "domain")
+}
+
+interface DomainEvent {
+ "The unique identifier of the event"
+ id: ID!
+ "The domain name associated with the event"
+ domain: Domain!
+ "The block number at which the event occurred"
+ blockNumber: Int!
+ "The transaction hash of the transaction that triggered the event"
+ transactionID: Bytes!
+}
+
+type Transfer implements DomainEvent @entity {
+ "The unique identifier of the event"
+ id: ID!
+ "The domain name associated with the event"
+ domain: Domain!
+ "The block number at which the event occurred"
+ blockNumber: Int!
+ "The transaction hash of the transaction that triggered the event"
+ transactionID: Bytes!
+ "The account that owns the domain after the transfer"
+ owner: Account!
+}
+
+type NewOwner implements DomainEvent @entity {
+ "The unique identifier of the event"
+ id: ID!
+ "The parent domain of the domain name associated with the event"
+ parentDomain: Domain!
+ "The domain name associated with the event"
+ domain: Domain!
+ "The block number at which the event occurred"
+ blockNumber: Int!
+ "The transaction hash of the transaction that triggered the event"
+ transactionID: Bytes!
+ "The new account that owns the domain"
+ owner: Account!
+}
+
+type NewResolver implements DomainEvent @entity {
+ "The unique identifier of the event"
+ id: ID!
+ "The domain name associated with the event"
+ domain: Domain!
+ "The block number at which the event occurred"
+ blockNumber: Int!
+ "The transaction hash of the transaction that triggered the event"
+ transactionID: Bytes!
+ "The new resolver contract address associated with the domain"
+ resolver: Resolver!
+}
+
+type NewTTL implements DomainEvent @entity {
+ "The unique identifier of the event"
+ id: ID!
+ "The domain name associated with the event"
+ domain: Domain!
+ "The block number at which the event occurred"
+ blockNumber: Int!
+ "The transaction hash of the transaction that triggered the event"
+ transactionID: Bytes!
+ "The new TTL value (in seconds) associated with the domain"
+ ttl: BigInt!
+}
+
+type WrappedTransfer implements DomainEvent @entity {
+ "The unique identifier of the event"
+ id: ID!
+ "The domain name associated with the event"
+ domain: Domain!
+ "The block number at which the event occurred"
+ blockNumber: Int!
+ "The transaction hash of the transaction that triggered the event"
+ transactionID: Bytes!
+ "The account that owns the wrapped domain after the transfer"
+ owner: Account!
+}
+
+type NameWrapped implements DomainEvent @entity {
+ "The unique identifier of the wrapped domain"
+ id: ID!
+ "The domain name associated with the wrapped domain"
+ domain: Domain!
+ "The block number at which the wrapped domain was wrapped"
+ blockNumber: Int!
+ "The transaction hash of the transaction that wrapped the domain"
+ transactionID: Bytes!
+ "The human-readable name of the wrapped domain"
+ name: String
+ "The number of fuses associated with the wrapped domain"
+ fuses: Int!
+ "The account that owns the wrapped domain"
+ owner: Account!
+ "The expiry date of the wrapped domain registration"
+ expiryDate: BigInt!
+}
+
+type NameUnwrapped implements DomainEvent @entity {
+ "The unique identifier of the event"
+ id: ID!
+ "The domain name associated with the event"
+ domain: Domain!
+ "The block number at which the event occurred"
+ blockNumber: Int!
+ "The transaction hash of the transaction that triggered the event"
+ transactionID: Bytes!
+ "The account that owns the domain after it was unwrapped"
+ owner: Account!
+}
+
+type FusesSet implements DomainEvent @entity {
+ "The unique identifier of the event"
+ id: ID!
+ "The domain name associated with the event"
+ domain: Domain!
+ "The block number at which the event occurred"
+ blockNumber: Int!
+ "The transaction hash of the transaction that triggered the event"
+ transactionID: Bytes!
+ "The number of fuses associated with the domain after the set event"
+ fuses: Int!
+}
+
+type ExpiryExtended implements DomainEvent @entity {
+ "The unique identifier of the event"
+ id: ID!
+ "The domain name associated with the event"
+ domain: Domain!
+ "The block number at which the event occurred"
+ blockNumber: Int!
+ "The transaction hash of the transaction that triggered the event"
+ transactionID: Bytes!
+ "The new expiry date associated with the domain after the extension event"
+ expiryDate: BigInt!
+}
+
+type Registration @entity {
+ "The unique identifier of the registration"
+ id: ID!
+ "The domain name associated with the registration"
+ domain: Domain!
+ "The registration date of the domain"
+ registrationDate: BigInt!
+ "The expiry date of the domain"
+ expiryDate: BigInt!
+ "The cost associated with the domain registration"
+ cost: BigInt
+ "The account that registered the domain"
+ registrant: Account!
+ "The human-readable label name associated with the domain registration"
+ labelName: String
+ "The events associated with the domain registration"
+ events: [RegistrationEvent!]! @derivedFrom(field: "registration")
+}
+
+interface RegistrationEvent {
+ "The unique identifier of the registration event"
+ id: ID!
+ "The registration associated with the event"
+ registration: Registration!
+ "The block number of the event"
+ blockNumber: Int!
+ "The transaction ID associated with the event"
+ transactionID: Bytes!
+}
+
+type NameRegistered implements RegistrationEvent @entity {
+ "The unique identifier of the NameRegistered event"
+ id: ID!
+ "The registration associated with the event"
+ registration: Registration!
+ "The block number of the event"
+ blockNumber: Int!
+ "The transaction ID associated with the event"
+ transactionID: Bytes!
+ "The account that registered the name"
+ registrant: Account!
+ "The expiry date of the registration"
+ expiryDate: BigInt!
+}
+
+type NameRenewed implements RegistrationEvent @entity {
+ "The unique identifier of the NameRenewed event"
+ id: ID!
+ "The registration associated with the event"
+ registration: Registration!
+ "The block number of the event"
+ blockNumber: Int!
+ "The transaction ID associated with the event"
+ transactionID: Bytes!
+ "The new expiry date of the registration"
+ expiryDate: BigInt!
+}
+
+type NameTransferred implements RegistrationEvent @entity {
+ "The ID of the event"
+ id: ID!
+ "The registration associated with the event"
+ registration: Registration!
+ "The block number of the event"
+ blockNumber: Int!
+ "The transaction ID of the event"
+ transactionID: Bytes!
+ "The new owner of the domain"
+ newOwner: Account!
+}
+
+type WrappedDomain @entity {
+ "unique identifier for each instance of the WrappedDomain entity"
+ id: ID!
+ "The domain that is wrapped by this WrappedDomain"
+ domain: Domain!
+ "The expiry date of the wrapped domain"
+ expiryDate: BigInt!
+ "The number of fuses remaining on the wrapped domain"
+ fuses: Int!
+ "The account that owns this WrappedDomain"
+ owner: Account!
+ "The name of the wrapped domain"
+ name: String
+}
+
+type Account @entity {
+ "The unique identifier for the account"
+ id: ID!
+ "The domains owned by the account"
+ domains: [Domain!]! @derivedFrom(field: "owner")
+ "The WrappedDomains owned by the account"
+ wrappedDomains: [WrappedDomain!] @derivedFrom(field: "owner")
+ "The Registrations made by the account"
+ registrations: [Registration!] @derivedFrom(field: "registrant")
+}
+
+type Resolver @entity {
+ "The unique identifier for this resolver, which is a concatenation of the resolver address and the domain namehash"
+ id: ID!
+ "The domain that this resolver is associated with"
+ domain: Domain
+ "The address of the resolver contract"
+ address: Bytes!
+ "The current value of the 'addr' record for this resolver, as determined by the associated events"
+ addr: Account
+ "The content hash for this resolver, in binary format"
+ contentHash: Bytes
+ "The set of observed text record keys for this resolver"
+ texts: [String!]
+ "The set of observed SLIP-44 coin types for this resolver"
+ coinTypes: [BigInt!]
+ "The events associated with this resolver"
+ events: [ResolverEvent!]! @derivedFrom(field: "resolver")
+}
+
+interface ResolverEvent {
+ "Concatenation of block number and log ID"
+ id: ID!
+ "Used to derive relationships to Resolvers"
+ resolver: Resolver!
+ "The block number that the event occurred on"
+ blockNumber: Int!
+ "The transaction hash of the event"
+ transactionID: Bytes!
+}
+
+type AddrChanged implements ResolverEvent @entity {
+ "Unique identifier for this event"
+ id: ID!
+ "The resolver associated with this event"
+ resolver: Resolver!
+ "The block number at which this event occurred"
+ blockNumber: Int!
+ "The transaction ID for the transaction in which this event occurred"
+ transactionID: Bytes!
+ "The new address associated with the resolver"
+ addr: Account!
+}
+
+type MulticoinAddrChanged implements ResolverEvent @entity {
+ "Unique identifier for the event"
+ id: ID!
+ "Resolver associated with this event"
+ resolver: Resolver!
+ "Block number in which this event was emitted"
+ blockNumber: Int!
+ "Transaction ID in which this event was emitted"
+ transactionID: Bytes!
+ "The coin type of the changed address"
+ coinType: BigInt!
+ "The new address value for the given coin type"
+ addr: Bytes!
+}
+
+type NameChanged implements ResolverEvent @entity {
+ "Concatenation of block number and log ID"
+ id: ID!
+ "Used to derive relationships to Resolvers"
+ resolver: Resolver!
+ "Block number where event occurred"
+ blockNumber: Int!
+ "Unique transaction ID where event occurred"
+ transactionID: Bytes!
+ "New ENS name value"
+ name: String!
+}
+
+type AbiChanged implements ResolverEvent @entity {
+ "Concatenation of block number and log ID"
+ id: ID!
+ "Used to derive relationships to Resolvers"
+ resolver: Resolver!
+ "The block number at which the event was emitted"
+ blockNumber: Int!
+ "The transaction hash of the transaction in which the event was emitted"
+ transactionID: Bytes!
+ "The content type of the ABI change"
+ contentType: BigInt!
+}
+
+type PubkeyChanged implements ResolverEvent @entity {
+ "Concatenation of block number and log ID"
+ id: ID!
+ "Used to derive relationships to Resolvers"
+ resolver: Resolver!
+ "Block number of the Ethereum block where the event occurred"
+ blockNumber: Int!
+ "Transaction hash of the Ethereum transaction where the event occurred"
+ transactionID: Bytes!
+ "The x-coordinate of the new public key"
+ x: Bytes!
+ "The y-coordinate of the new public key"
+ y: Bytes!
+}
+
+type TextChanged implements ResolverEvent @entity {
+ "Concatenation of block number and log ID"
+ id: ID!
+ "Used to derive relationships to Resolvers"
+ resolver: Resolver!
+ "Block number of the Ethereum block in which the event occurred"
+ blockNumber: Int!
+ "Hash of the Ethereum transaction in which the event occurred"
+ transactionID: Bytes!
+ "The key of the text record that was changed"
+ key: String!
+ "The new value of the text record that was changed"
+ value: String
+}
+
+type ContenthashChanged implements ResolverEvent @entity {
+ "Concatenation of block number and log ID"
+ id: ID!
+ "Used to derive relationships to Resolvers"
+ resolver: Resolver!
+ "The block number where the event occurred"
+ blockNumber: Int!
+ "The ID of the transaction where the event occurred"
+ transactionID: Bytes!
+ "The new content hash for the domain"
+ hash: Bytes!
+}
+
+type InterfaceChanged implements ResolverEvent @entity {
+ "Concatenation of block number and log ID"
+ id: ID!
+ "Used to derive relationships to Resolvers"
+ resolver: Resolver!
+ "The block number in which the event occurred"
+ blockNumber: Int!
+ "The transaction ID for the transaction in which the event occurred"
+ transactionID: Bytes!
+ "The ID of the EIP-1820 interface that was changed"
+ interfaceID: Bytes!
+ "The address of the contract that implements the interface"
+ implementer: Bytes!
+}
+
+type AuthorisationChanged implements ResolverEvent @entity {
+ "Unique identifier for this event"
+ id: ID!
+ "The resolver associated with this event"
+ resolver: Resolver!
+ "The block number at which the event occurred"
+ blockNumber: Int!
+ "The transaction hash associated with the event"
+ transactionID: Bytes!
+ "The owner of the authorisation"
+ owner: Bytes!
+ "The target of the authorisation"
+ target: Bytes!
+ "Whether the authorisation was added or removed"
+ isAuthorized: Boolean!
+}
+
+type VersionChanged implements ResolverEvent @entity {
+ "Unique identifier for this event"
+ id: ID!
+ "The resolver associated with this event"
+ resolver: Resolver!
+ "The block number at which the event occurred"
+ blockNumber: Int!
+ "The transaction hash associated with the event"
+ transactionID: Bytes!
+ "The new version number of the resolver"
+ version: BigInt!
+}
diff --git a/packages/ens-subgraph/src/@types/assembly/index.d.ts b/packages/ens-subgraph/src/@types/assembly/index.d.ts
new file mode 100644
index 000000000..2a91f3ced
--- /dev/null
+++ b/packages/ens-subgraph/src/@types/assembly/index.d.ts
@@ -0,0 +1,2752 @@
+/**
+ * Environment definitions for compiling AssemblyScript to WebAssembly using asc.
+ * @module std/assembly
+ */ /***/
+
+///
+
+// Types
+
+/** An 8-bit signed integer. */
+declare type i8 = number;
+/** A 16-bit signed integer. */
+declare type i16 = number;
+/** A 32-bit signed integer. */
+declare type i32 = number;
+/** A 64-bit signed integer. */
+declare type i64 = number;
+/** A 32-bit signed integer when targeting 32-bit WebAssembly or a 64-bit signed integer when targeting 64-bit WebAssembly. */
+declare type isize = number;
+/** An 8-bit unsigned integer. */
+declare type u8 = number;
+/** A 16-bit unsigned integer. */
+declare type u16 = number;
+/** A 32-bit unsigned integer. */
+declare type u32 = number;
+/** A 64-bit unsigned integer. */
+declare type u64 = number;
+/** A 32-bit unsigned integer when targeting 32-bit WebAssembly or a 64-bit unsigned integer when targeting 64-bit WebAssembly. */
+declare type usize = number;
+/** A 1-bit unsigned integer. */
+declare type bool = boolean | number;
+/** A 32-bit float. */
+declare type f32 = number;
+/** A 64-bit float. */
+declare type f64 = number;
+/** A 128-bit vector. */
+declare type v128 = object;
+/** Function reference. */
+declare type funcref = object | null;
+/** External reference. */
+declare type externref = object | null;
+/** Any reference. */
+declare type anyref = object | null;
+/** Equatable reference. */
+declare type eqref = object | null;
+/** 31-bit integer reference. */
+declare type i31ref = object | null;
+/** Data reference. */
+declare type dataref = object | null;
+
+// Compiler hints
+
+/** Compiler target. 0 = JS, 1 = WASM32, 2 = WASM64. */
+declare const ASC_TARGET: i32;
+/** Runtime type. 0 = Stub, 1 = Minimal, 2 = Incremental. */
+declare const ASC_RUNTIME: i32;
+/** Provided noAssert option. */
+declare const ASC_NO_ASSERT: bool;
+/** Provided memoryBase option. */
+declare const ASC_MEMORY_BASE: i32;
+/** Provided tableBase option. */
+declare const ASC_TABLE_BASE: i32;
+/** Provided optimizeLevel option. */
+declare const ASC_OPTIMIZE_LEVEL: i32;
+/** Provided shrinkLevel option. */
+declare const ASC_SHRINK_LEVEL: i32;
+/** Provided lowMemoryLimit option. */
+declare const ASC_LOW_MEMORY_LIMIT: i32;
+/** Provided noExportRuntime option. */
+declare const ASC_NO_EXPORT_RUNTIME: i32;
+/** Whether the sign extension feature is enabled. */
+declare const ASC_FEATURE_SIGN_EXTENSION: bool;
+/** Whether the mutable globals feature is enabled. */
+declare const ASC_FEATURE_MUTABLE_GLOBALS: bool;
+/** Whether the non-trapping float-to-int feature is enabled. */
+declare const ASC_FEATURE_NONTRAPPING_F2I: bool;
+/** Whether the bulk memory feature is enabled. */
+declare const ASC_FEATURE_BULK_MEMORY: bool;
+/** Whether the SIMD feature is enabled. */
+declare const ASC_FEATURE_SIMD: bool;
+/** Whether the threads feature is enabled. */
+declare const ASC_FEATURE_THREADS: bool;
+/** Whether the exception handling feature is enabled. */
+declare const ASC_FEATURE_EXCEPTION_HANDLING: bool;
+/** Whether the tail calls feature is enabled. */
+declare const ASC_FEATURE_TAIL_CALLS: bool;
+/** Whether the reference types feature is enabled. */
+declare const ASC_FEATURE_REFERENCE_TYPES: bool;
+/** Whether the multi value types feature is enabled. */
+declare const ASC_FEATURE_MULTI_VALUE: bool;
+/** Whether the garbage collection feature is enabled. */
+declare const ASC_FEATURE_GC: bool;
+/** Whether the memory64 feature is enabled. */
+declare const ASC_FEATURE_MEMORY64: bool;
+/** Major version of the compiler. */
+declare const ASC_VERSION_MAJOR: i32;
+/** Minor version of the compiler. */
+declare const ASC_VERSION_MINOR: i32;
+/** Patch version of the compiler. */
+declare const ASC_VERSION_PATCH: i32;
+
+// Builtins
+
+/** Performs the sign-agnostic count leading zero bits operation on a 32-bit or 64-bit integer. All zero bits are considered leading if the value is zero. */
+declare function clz(value: T): T;
+/** Performs the sign-agnostic count tailing zero bits operation on a 32-bit or 64-bit integer. All zero bits are considered trailing if the value is zero. */
+declare function ctz(value: T): T;
+/** Performs the sign-agnostic count number of one bits operation on a 32-bit or 64-bit integer. */
+declare function popcnt(value: T): T;
+/** Performs the sign-agnostic rotate left operation on a 32-bit or 64-bit integer. */
+declare function rotl(value: T, shift: T): T;
+/** Performs the sign-agnostic rotate right operation on a 32-bit or 64-bit integer. */
+declare function rotr(value: T, shift: T): T;
+/** Computes the absolute value of an integer or float. */
+declare function abs(value: T): T;
+/** Determines the maximum of two integers or floats. If either operand is `NaN`, returns `NaN`. */
+declare function max(left: T, right: T): T;
+/** Determines the minimum of two integers or floats. If either operand is `NaN`, returns `NaN`. */
+declare function min(left: T, right: T): T;
+/** Performs the ceiling operation on a 32-bit or 64-bit float. */
+declare function ceil(value: T): T;
+/** Composes a 32-bit or 64-bit float from the magnitude of `x` and the sign of `y`. */
+declare function copysign(x: T, y: T): T;
+/** Performs the floor operation on a 32-bit or 64-bit float. */
+declare function floor(value: T): T;
+/** Rounds to the nearest integer tied to even of a 32-bit or 64-bit float. */
+declare function nearest(value: T): T;
+/** Reinterprets the bits of the specified value as type `T`. Valid reinterpretations are u32/i32 to/from f32 and u64/i64 to/from f64. */
+declare function reinterpret(value: number): T;
+/** Selects one of two pre-evaluated values depending on the condition. */
+declare function select(ifTrue: T, ifFalse: T, condition: bool): T;
+/** Calculates the square root of a 32-bit or 64-bit float. */
+declare function sqrt(value: T): T;
+/** Rounds to the nearest integer towards zero of a 32-bit or 64-bit float. */
+declare function trunc(value: T): T;
+/** Computes the sum of two integers or floats. */
+declare function add(left: T, right: T): T;
+/** Computes the difference of two integers or floats. */
+declare function sub(left: T, right: T): T;
+/** Computes the product of two integers or floats. */
+declare function mul(left: T, right: T): T;
+/** Computes the quotient of two integers or floats. */
+declare function div(left: T, right: T): T;
+/** Loads a value of the specified type from memory. Equivalent to dereferncing a pointer in other languages. */
+declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): T;
+/** Stores a value of the specified type to memory. Equivalent to dereferencing a pointer in other languages when assigning a value. */
+declare function store(
+ ptr: usize,
+ value: T,
+ immOffset?: usize,
+ immAlign?: usize
+): void;
+/** Emits an unreachable operation that results in a runtime error when executed. Both a statement and an expression. */
+declare function unreachable(): never;
+
+/** NaN (not a number) as a 32-bit or 64-bit float depending on context. */
+declare const NaN: f32 | f64;
+/** Positive infinity as a 32-bit or 64-bit float depending on context. */
+declare const Infinity: f32 | f64;
+/** Data end offset. */
+declare const __data_end: usize;
+/** Stack pointer offset. */
+declare var __stack_pointer: usize;
+/** Heap base offset. */
+declare const __heap_base: usize;
+/** Determines the byte size of the specified underlying core type. Compiles to a constant. */
+declare function sizeof(): usize;
+/** Determines the alignment (log2) of the specified underlying core type. Compiles to a constant. */
+declare function alignof(): usize;
+/** Determines the end offset of the given class type. Compiles to a constant. */
+declare function offsetof(): usize;
+/** Determines the offset of the specified field within the given class type. Compiles to a constant. */
+declare function offsetof(fieldName: keyof T | string): usize;
+/** Determines the offset of the specified field within the given class type. Returns the class type's end offset if field name has been omitted. Compiles to a constant. */
+declare function offsetof(fieldName?: string): usize;
+/** Determines the name of a given type. */
+declare function nameof(value?: T): string;
+/** Determines the unique runtime id of a class type. Compiles to a constant. */
+declare function idof(): u32;
+/** Changes the type of any value of `usize` kind to another one of `usize` kind. Useful for casting class instances to their pointer values and vice-versa. Beware that this is unsafe.*/
+declare function changetype(value: any): T;
+/** Explicitly requests no bounds checks on the provided expression. Useful for array accesses. */
+declare function unchecked(value: T): T;
+/** Emits a `call_indirect` instruction, calling the specified function in the function table by index with the specified arguments. Does result in a runtime error if the arguments do not match the called function. */
+declare function call_indirect(index: u32, ...args: unknown[]): T;
+/** Instantiates a new instance of `T` using the specified constructor arguments. */
+declare function instantiate(...args: any[]): T;
+/** Tests if a 32-bit or 64-bit float is `NaN`. */
+declare function isNaN(value: T): bool;
+/** Tests if a 32-bit or 64-bit float is finite, that is not `NaN` or +/-`Infinity`. */
+declare function isFinite(value: T): bool;
+/** Tests if the specified type *or* expression is of an integer type and not a reference. Compiles to a constant. */
+declare function isInteger(value?: any): value is number;
+/** Tests if the specified type *or* expression is of a float type. Compiles to a constant. */
+declare function isFloat(value?: any): value is number;
+/** Tests if the specified type *or* expression is of a boolean type. */
+declare function isBoolean(value?: any): value is number;
+/** Tests if the specified type *or* expression can represent negative numbers. Compiles to a constant. */
+declare function isSigned(value?: any): value is number;
+/** Tests if the specified type *or* expression is of a reference type. Compiles to a constant. */
+declare function isReference(value?: any): value is object | string;
+/** Tests if the specified type *or* expression can be used as a string. Compiles to a constant. */
+declare function isString(value?: any): value is string | String;
+/** Tests if the specified type *or* expression can be used as an array. Compiles to a constant. */
+declare function isArray(value?: any): value is Array;
+/** Tests if the specified type *or* expression can be used as an array like object. Compiles to a constant. */
+declare function isArrayLike(value?: any): value is ArrayLike;
+/** Tests if the specified type *or* expression is of a function type. Compiles to a constant. */
+declare function isFunction(value?: any): value is (...args: any) => any;
+/** Tests if the specified type *or* expression is of a nullable reference type. Compiles to a constant. */
+declare function isNullable(value?: T | null): value is null;
+/** Tests if the specified expression resolves to a defined element. Compiles to a constant. */
+declare function isDefined(expression: any): bool;
+/** Tests if the specified expression evaluates to a constant value. Compiles to a constant. */
+declare function isConstant(expression: any): bool;
+/** Tests if the specified type *or* expression is of a managed type. Compiles to a constant. */
+declare function isManaged(value?: any): bool;
+/** Tests if the specified type is void. Compiles to a constant. */
+declare function isVoid(): bool;
+/** Traps if the specified value is not true-ish, otherwise returns the (non-nullable) value. */
+declare function assert(
+ isTrueish: T,
+ message?: string
+): T & (object | string | number); // any better way to model `: T != null`?
+/** Parses an integer string to a 64-bit float. */
+declare function parseInt(str: string, radix?: i32): f64;
+/** Parses a string to a 64-bit float. */
+declare function parseFloat(str: string): f64;
+/** Returns the 64-bit floating-point remainder of `x/y`. */
+declare function fmod(x: f64, y: f64): f64;
+/** Returns the 32-bit floating-point remainder of `x/y`. */
+declare function fmodf(x: f32, y: f32): f32;
+/** Returns the number of parameters in the given function signature type. */
+declare function lengthof any>(func?: T): i32;
+/** Encodes a text string as a valid Uniform Resource Identifier (URI). */
+declare function encodeURI(str: string): string;
+/** Encodes a text string as a valid component of a Uniform Resource Identifier (URI). */
+declare function encodeURIComponent(str: string): string;
+/** Decodes a Uniform Resource Identifier (URI) previously created by encodeURI. */
+declare function decodeURI(str: string): string;
+/** Decodes a Uniform Resource Identifier (URI) component previously created by encodeURIComponent. */
+declare function decodeURIComponent(str: string): string;
+
+/** Atomic operations. */
+declare namespace atomic {
+ /** Atomically loads an integer value from memory and returns it. */
+ export function load(ptr: usize, immOffset?: usize): T;
+ /** Atomically stores an integer value to memory. */
+ export function store(ptr: usize, value: T, immOffset?: usize): void;
+ /** Atomically adds an integer value in memory. */
+ export function add(ptr: usize, value: T, immOffset?: usize): T;
+ /** Atomically subtracts an integer value in memory. */
+ export function sub(ptr: usize, value: T, immOffset?: usize): T;
+ /** Atomically performs a bitwise AND operation on an integer value in memory. */
+ export function and(ptr: usize, value: T, immOffset?: usize): T;
+ /** Atomically performs a bitwise OR operation on an integer value in memory. */
+ export function or(ptr: usize, value: T, immOffset?: usize): T;
+ /** Atomically performs a bitwise XOR operation on an integer value in memory. */
+ export function xor(ptr: usize, value: T, immOffset?: usize): T;
+ /** Atomically exchanges an integer value in memory. */
+ export function xchg(ptr: usize, value: T, immOffset?: usize): T;
+ /** Atomically compares and exchanges an integer value in memory if the condition is met. */
+ export function cmpxchg(
+ ptr: usize,
+ expected: T,
+ replacement: T,
+ immOffset?: usize
+ ): T;
+ /** Performs a wait operation on an address in memory suspending this agent if the integer condition is met. */
+ export function wait(
+ ptr: usize,
+ expected: T,
+ timeout?: i64
+ ): AtomicWaitResult;
+ /** Performs a notify operation on an address in memory waking up suspended agents. */
+ export function notify(ptr: usize, count?: i32): i32;
+ /** Performs a fence operation, preserving synchronization guarantees of higher level languages. */
+ export function fence(): void;
+}
+
+/** Describes the result of an atomic wait operation. */
+declare enum AtomicWaitResult {
+ /** Woken by another agent. */
+ OK,
+ /** Loaded value did not match the expected value. */
+ NOT_EQUAL,
+ /** Not woken before the timeout expired. */
+ TIMED_OUT,
+}
+
+/** Converts any other numeric value to an 8-bit signed integer. */
+declare function i8(value: any): i8;
+declare namespace i8 {
+ /** Smallest representable value. */
+ export const MIN_VALUE: i8;
+ /** Largest representable value. */
+ export const MAX_VALUE: i8;
+}
+/** Converts any other numeric value to a 16-bit signed integer. */
+declare function i16(value: any): i16;
+declare namespace i16 {
+ /** Smallest representable value. */
+ export const MIN_VALUE: i16;
+ /** Largest representable value. */
+ export const MAX_VALUE: i16;
+}
+/** Converts any other numeric value to a 32-bit signed integer. */
+declare function i32(value: any): i32;
+declare namespace i32 {
+ /** Smallest representable value. */
+ export const MIN_VALUE: i32;
+ /** Largest representable value. */
+ export const MAX_VALUE: i32;
+ /** Loads an 8-bit signed integer value from memory and returns it as a 32-bit integer. */
+ export function load8_s(ptr: usize, immOffset?: usize, immAlign?: usize): i32;
+ /** Loads an 8-bit unsigned integer value from memory and returns it as a 32-bit integer. */
+ export function load8_u(ptr: usize, immOffset?: usize, immAlign?: usize): i32;
+ /** Loads a 16-bit signed integer value from memory and returns it as a 32-bit integer. */
+ export function load16_s(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): i32;
+ /** Loads a 16-bit unsigned integer value from memory and returns it as a 32-bit integer. */
+ export function load16_u(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): i32;
+ /** Loads a 32-bit integer value from memory. */
+ export function load(ptr: usize, immOffset?: usize, immAlign?: usize): i32;
+ /** Stores a 32-bit integer value to memory as an 8-bit integer. */
+ export function store8(
+ ptr: usize,
+ value: i32,
+ immOffset?: usize,
+ immAlign?: usize
+ ): void;
+ /** Stores a 32-bit integer value to memory as a 16-bit integer. */
+ export function store16(
+ ptr: usize,
+ value: i32,
+ immOffset?: usize,
+ immAlign?: usize
+ ): void;
+ /** Stores a 32-bit integer value to memory. */
+ export function store(
+ ptr: usize,
+ value: i32,
+ immOffset?: usize,
+ immAlign?: usize
+ ): void;
+ /** Performs the sign-agnostic count leading zero bits operation on a 32-bit integer. All zero bits are considered leading if the value is zero. */
+ export function clz(value: i32): i32;
+ /** Performs the sign-agnostic count tailing zero bits operation on a 32-bit integer. All zero bits are considered trailing if the value is zero. */
+ export function ctz(value: i32): i32;
+ /** Performs the sign-agnostic count number of one bits operation on a 32-bit integer. */
+ export function popcnt(value: i32): i32;
+ /** Performs the sign-agnostic rotate left operation on a 32-bit integer. */
+ export function rotl(value: i32, shift: i32): i32;
+ /** Performs the sign-agnostic rotate right operation on a 32-bit integer. */
+ export function rotr(value: i32, shift: i32): i32;
+ /** Reinterprets the bits of the specified 32-bit float as a 32-bit integer. */
+ export function reinterpret_f32(value: f32): i32;
+ /** Computes the sum of two 32-bit integers. */
+ export function add(left: i32, right: i32): i32;
+ /** Computes the difference of two 32-bit integers. */
+ export function sub(left: i32, right: i32): i32;
+ /** Computes the product of two 32-bit integers. */
+ export function mul(left: i32, right: i32): i32;
+ /** Computes the signed quotient of two 32-bit integers. */
+ export function div_s(left: i32, right: i32): i32;
+ /** Computes the unsigned quotient of two 32-bit integers. */
+ export function div_u(left: i32, right: i32): i32;
+ /** Atomic 32-bit integer operations. */
+ export namespace atomic {
+ /** Atomically loads an 8-bit unsigned integer value from memory and returns it as a 32-bit integer. */
+ export function load8_u(ptr: usize, immOffset?: usize): i32;
+ /** Atomically loads a 16-bit unsigned integer value from memory and returns it as a 32-bit integer. */
+ export function load16_u(ptr: usize, immOffset?: usize): i32;
+ /** Atomically loads a 32-bit integer value from memory and returns it. */
+ export function load(ptr: usize, immOffset?: usize): i32;
+ /** Atomically stores a 32-bit integer value to memory as an 8-bit integer. */
+ export function store8(ptr: usize, value: i32, immOffset?: usize): void;
+ /** Atomically stores a 32-bit integer value to memory as a 16-bit integer. */
+ export function store16(ptr: usize, value: i32, immOffset?: usize): void;
+ /** Atomically stores a 32-bit integer value to memory. */
+ export function store(ptr: usize, value: i32, immOffset?: usize): void;
+ /** Performs a wait operation on a 32-bit integer value in memory suspending this agent if the condition is met. */
+ export function wait(
+ ptr: usize,
+ expected: i32,
+ timeout?: i64
+ ): AtomicWaitResult;
+ /** Atomic 32-bit integer read-modify-write operations on 8-bit values. */
+ export namespace rmw8 {
+ /** Atomically adds an 8-bit unsigned integer value in memory. */
+ export function add_u(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically subtracts an 8-bit unsigned integer value in memory. */
+ export function sub_u(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically performs a bitwise AND operation an 8-bit unsigned integer value in memory. */
+ export function and_u(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically performs a bitwise OR operation an 8-bit unsigned integer value in memory. */
+ export function or_u(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically performs a bitwise XOR operation an 8-bit unsigned integer value in memory. */
+ export function xor_u(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically exchanges an 8-bit unsigned integer value in memory. */
+ export function xchg_u(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically compares and exchanges an 8-bit unsigned integer value in memory if the condition is met. */
+ export function cmpxchg_u(
+ ptr: usize,
+ expected: i32,
+ replacement: i32,
+ immOffset?: usize
+ ): i32;
+ }
+ /** Atomic 32-bit integer read-modify-write operations on 16-bit values. */
+ export namespace rmw16 {
+ /** Atomically adds a 16-bit unsigned integer value in memory. */
+ export function add_u(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically adds a 16-bit unsigned integer value in memory. */
+ export function sub_u(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically performs a bitwise AND operation a 16-bit unsigned integer value in memory. */
+ export function and_u(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically performs a bitwise OR operation a 16-bit unsigned integer value in memory. */
+ export function or_u(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically performs a bitwise XOR operation a 16-bit unsigned integer value in memory. */
+ export function xor_u(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically exchanges a 16-bit unsigned integer value in memory. */
+ export function xchg_u(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically compares and exchanges a 16-bit unsigned integer value in memory if the condition is met. */
+ export function cmpxchg_u(
+ ptr: usize,
+ expected: i32,
+ replacement: i32,
+ immOffset?: usize
+ ): i32;
+ }
+ /** Atomic 32-bit integer read-modify-write operations. */
+ export namespace rmw {
+ /** Atomically adds a 32-bit integer value in memory. */
+ export function add(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically subtracts a 32-bit integer value in memory. */
+ export function sub(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically performs a bitwise AND operation a 32-bit integer value in memory. */
+ export function and(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically performs a bitwise OR operation a 32-bit integer value in memory. */
+ export function or(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically performs a bitwise XOR operation a 32-bit integer value in memory. */
+ export function xor(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically exchanges a 32-bit integer value in memory. */
+ export function xchg(ptr: usize, value: i32, immOffset?: usize): i32;
+ /** Atomically compares and exchanges a 32-bit integer value in memory if the condition is met. */
+ export function cmpxchg(
+ ptr: usize,
+ expected: i32,
+ replacement: i32,
+ immOffset?: usize
+ ): i32;
+ }
+ }
+}
+/** Converts any other numeric value to a 64-bit signed integer. */
+declare function i64(value: any): i64;
+declare namespace i64 {
+ /** Smallest representable value. */
+ export const MIN_VALUE: i64;
+ /** Largest representable value. */
+ export const MAX_VALUE: i64;
+ /** Loads an 8-bit signed integer value from memory and returns it as a 64-bit integer. */
+ export function load8_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64;
+ /** Loads an 8-bit unsigned integer value from memory and returns it as a 64-bit integer. */
+ export function load8_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64;
+ /** Loads a 16-bit signed integer value from memory and returns it as a 64-bit integer. */
+ export function load16_s(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): i64;
+ /** Loads a 16-bit unsigned integer value from memory and returns it as a 64-bit integer. */
+ export function load16_u(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): i64;
+ /** Loads a 32-bit signed integer value from memory and returns it as a 64-bit integer. */
+ export function load32_s(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): i64;
+ /** Loads a 32-bit unsigned integer value from memory and returns it as a 64-bit integer. */
+ export function load32_u(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): i64;
+ /** Loads a 64-bit unsigned integer value from memory. */
+ export function load(ptr: usize, immOffset?: usize, immAlign?: usize): i64;
+ /** Stores a 64-bit integer value to memory as an 8-bit integer. */
+ export function store8(
+ ptr: usize,
+ value: i64,
+ immOffset?: usize,
+ immAlign?: usize
+ ): void;
+ /** Stores a 64-bit integer value to memory as a 16-bit integer. */
+ export function store16(
+ ptr: usize,
+ value: i64,
+ immOffset?: usize,
+ immAlign?: usize
+ ): void;
+ /** Stores a 64-bit integer value to memory as a 32-bit integer. */
+ export function store32(
+ ptr: usize,
+ value: i64,
+ immOffset?: usize,
+ immAlign?: usize
+ ): void;
+ /** Stores a 64-bit integer value to memory. */
+ export function store(
+ ptr: usize,
+ value: i64,
+ immOffset?: usize,
+ immAlign?: usize
+ ): void;
+ /** Performs the sign-agnostic count leading zero bits operation on a 64-bit integer. All zero bits are considered leading if the value is zero. */
+ export function clz(value: i64): i64;
+ /** Performs the sign-agnostic count tailing zero bits operation on a 64-bit integer. All zero bits are considered trailing if the value is zero. */
+ export function ctz(value: i64): i64;
+ /** Performs the sign-agnostic count number of one bits operation on a 64-bit integer. */
+ export function popcnt(value: i64): i64;
+ /** Performs the sign-agnostic rotate left operation on a 64-bit integer. */
+ export function rotl(value: i64, shift: i64): i64;
+ /** Performs the sign-agnostic rotate right operation on a 64-bit integer. */
+ export function rotr(value: i64, shift: i64): i64;
+ /** Reinterprets the bits of the specified 64-bit float as a 64-bit integer. */
+ export function reinterpret_f64(value: f64): i64;
+ /** Computes the sum of two 64-bit integers. */
+ export function add(left: i64, right: i64): i64;
+ /** Computes the difference of two 64-bit integers. */
+ export function sub(left: i64, right: i64): i64;
+ /** Computes the product of two 64-bit integers. */
+ export function mul(left: i64, right: i64): i64;
+ /** Computes the signed quotient of two 64-bit integers. */
+ export function div_s(left: i64, right: i64): i64;
+ /** Computes the unsigned quotient of two 64-bit integers. */
+ export function div_u(left: i64, right: i64): i64;
+ /** Atomic 64-bit integer operations. */
+ export namespace atomic {
+ /** Atomically loads an 8-bit unsigned integer value from memory and returns it as a 64-bit integer. */
+ export function load8_u(ptr: usize, immOffset?: usize): i64;
+ /** Atomically loads a 16-bit unsigned integer value from memory and returns it as a 64-bit integer. */
+ export function load16_u(ptr: usize, immOffset?: usize): i64;
+ /** Atomically loads a 32-bit unsigned integer value from memory and returns it as a 64-bit integer. */
+ export function load32_u(ptr: usize, immOffset?: usize): i64;
+ /** Atomically loads a 64-bit integer value from memory and returns it. */
+ export function load(ptr: usize, immOffset?: usize): i64;
+ /** Atomically stores a 64-bit integer value to memory as an 8-bit integer. */
+ export function store8(ptr: usize, value: i64, immOffset?: usize): void;
+ /** Atomically stores a 64-bit integer value to memory as a 16-bit integer. */
+ export function store16(ptr: usize, value: i64, immOffset?: usize): void;
+ /** Atomically stores a 64-bit integer value to memory as a 32-bit integer. */
+ export function store32(ptr: usize, value: i64, immOffset?: usize): void;
+ /** Atomically stores a 64-bit integer value to memory. */
+ export function store(ptr: usize, value: i64, immOffset?: usize): void;
+ /** Performs a wait operation on a 64-bit integer value in memory suspending this agent if the condition is met. */
+ export function wait(
+ ptr: usize,
+ expected: i64,
+ timeout?: i64
+ ): AtomicWaitResult;
+ /** Atomic 64-bit integer read-modify-write operations on 8-bit values. */
+ export namespace rmw8 {
+ /** Atomically adds an 8-bit unsigned integer value in memory. */
+ export function add_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically subtracts an 8-bit unsigned integer value in memory. */
+ export function sub_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically performs a bitwise AND operation on an 8-bit unsigned integer value in memory. */
+ export function and_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically performs a bitwise OR operation on an 8-bit unsigned integer value in memory. */
+ export function or_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically performs a bitwise XOR operation on an 8-bit unsigned integer value in memory. */
+ export function xor_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically exchanges an 8-bit unsigned integer value in memory. */
+ export function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically compares and exchanges an 8-bit unsigned integer value in memory if the condition is met. */
+ export function cmpxchg_u(
+ ptr: usize,
+ expected: i64,
+ replacement: i64,
+ immOffset?: usize
+ ): i64;
+ }
+ /** Atomic 64-bit integer read-modify-write operations on 16-bit values. */
+ export namespace rmw16 {
+ /** Atomically adds a 16-bit unsigned integer value in memory. */
+ export function add_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically subtracts a 16-bit unsigned integer value in memory. */
+ export function sub_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically performs a bitwise AND operation on a 16-bit unsigned integer value in memory. */
+ export function and_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically performs a bitwise OR operation on a 16-bit unsigned integer value in memory. */
+ export function or_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically performs a bitwise XOR operation on a 16-bit unsigned integer value in memory. */
+ export function xor_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically exchanges a 16-bit unsigned integer value in memory. */
+ export function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically compares and exchanges a 16-bit unsigned integer value in memory if the condition is met. */
+ export function cmpxchg_u(
+ ptr: usize,
+ expected: i64,
+ replacement: i64,
+ immOffset?: usize
+ ): i64;
+ }
+ /** Atomic 64-bit integer read-modify-write operations on 32-bit values. */
+ export namespace rmw32 {
+ /** Atomically adds a 32-bit unsigned integer value in memory. */
+ export function add_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically subtracts a 32-bit unsigned integer value in memory. */
+ export function sub_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically performs a bitwise AND operation on a 32-bit unsigned integer value in memory. */
+ export function and_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically performs a bitwise OR operation on a 32-bit unsigned integer value in memory. */
+ export function or_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically performs a bitwise XOR operation on a 32-bit unsigned integer value in memory. */
+ export function xor_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically exchanges a 32-bit unsigned integer value in memory. */
+ export function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically compares and exchanges a 32-bit unsigned integer value in memory if the condition is met. */
+ export function cmpxchg_u(
+ ptr: usize,
+ expected: i64,
+ replacement: i64,
+ immOffset?: usize
+ ): i64;
+ }
+ /** Atomic 64-bit integer read-modify-write operations. */
+ export namespace rmw {
+ /** Atomically adds a 64-bit integer value in memory. */
+ export function add(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically subtracts a 64-bit integer value in memory. */
+ export function sub(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically performs a bitwise AND operation on a 64-bit integer value in memory. */
+ export function and(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically performs a bitwise OR operation on a 64-bit integer value in memory. */
+ export function or(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically performs a bitwise XOR operation on a 64-bit integer value in memory. */
+ export function xor(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically exchanges a 64-bit integer value in memory. */
+ export function xchg(ptr: usize, value: i64, immOffset?: usize): i64;
+ /** Atomically compares and exchanges a 64-bit integer value in memory if the condition is met. */
+ export function cmpxchg(
+ ptr: usize,
+ expected: i64,
+ replacement: i64,
+ immOffset?: usize
+ ): i64;
+ }
+ }
+}
+/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) signed integer. */
+declare var isize: typeof i32 | typeof i64;
+/** Converts any other numeric value to an 8-bit unsigned integer. */
+declare function u8(value: any): u8;
+declare namespace u8 {
+ /** Smallest representable value. */
+ export const MIN_VALUE: u8;
+ /** Largest representable value. */
+ export const MAX_VALUE: u8;
+}
+/** Converts any other numeric value to a 16-bit unsigned integer. */
+declare function u16(value: any): u16;
+declare namespace u16 {
+ /** Smallest representable value. */
+ export const MIN_VALUE: u16;
+ /** Largest representable value. */
+ export const MAX_VALUE: u16;
+}
+/** Converts any other numeric value to a 32-bit unsigned integer. */
+declare function u32(value: any): u32;
+declare namespace u32 {
+ /** Smallest representable value. */
+ export const MIN_VALUE: u32;
+ /** Largest representable value. */
+ export const MAX_VALUE: u32;
+}
+/** Converts any other numeric value to a 64-bit unsigned integer. */
+declare function u64(value: any): u64;
+declare namespace u64 {
+ /** Smallest representable value. */
+ export const MIN_VALUE: u64;
+ /** Largest representable value. */
+ export const MAX_VALUE: u64;
+}
+/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) unsigned integer. */
+declare var usize: typeof u32 | typeof u64;
+/** Converts any other numeric value to a 1-bit unsigned integer. */
+declare function bool(value: any): bool;
+declare namespace bool {
+ /** Smallest representable value. */
+ export const MIN_VALUE: bool;
+ /** Largest representable value. */
+ export const MAX_VALUE: bool;
+}
+/** Converts any other numeric value to a 32-bit float. */
+declare function f32(value: any): f32;
+declare namespace f32 {
+ /** Smallest representable value. */
+ export const MIN_VALUE: f32;
+ /** Largest representable value. */
+ export const MAX_VALUE: f32;
+ /** Smallest normalized positive value. */
+ export const MIN_NORMAL_VALUE: f32;
+ /** Smallest safely representable integer value. */
+ export const MIN_SAFE_INTEGER: f32;
+ /** Largest safely representable integer value. */
+ export const MAX_SAFE_INTEGER: f32;
+ /** Positive infinity value. */
+ export const POSITIVE_INFINITY: f32;
+ /** Negative infinity value. */
+ export const NEGATIVE_INFINITY: f32;
+ /** Not a number value. */
+ export const NaN: f32;
+ /** Difference between 1 and the smallest representable value greater than 1. */
+ export const EPSILON: f32;
+ /** Loads a 32-bit float from memory. */
+ export function load(ptr: usize, immOffset?: usize, immAlign?: usize): f32;
+ /** Stores a 32-bit float to memory. */
+ export function store(
+ ptr: usize,
+ value: f32,
+ immOffset?: usize,
+ immAlign?: usize
+ ): void;
+ /** Computes the sum of two 32-bit floats. */
+ export function add(left: f32, right: f32): f32;
+ /** Computes the difference of two 32-bit floats. */
+ export function sub(left: f32, right: f32): f32;
+ /** Computes the product of two 32-bit floats. */
+ export function mul(left: f32, right: f32): f32;
+ /** Computes the quotient of two 32-bit floats. */
+ export function div(left: f32, right: f32): f32;
+ /** Computes the absolute value of a 32-bit float. */
+ export function abs(value: f32): f32;
+ /** Determines the maximum of two 32-bit floats. If either operand is `NaN`, returns `NaN`. */
+ export function max(left: f32, right: f32): f32;
+ /** Determines the minimum of two 32-bit floats. If either operand is `NaN`, returns `NaN`. */
+ export function min(left: f32, right: f32): f32;
+ /** Performs the ceiling operation on a 32-bit float. */
+ export function ceil(value: f32): f32;
+ /** Composes a 32-bit float from the magnitude of `x` and the sign of `y`. */
+ export function copysign(x: f32, y: f32): f32;
+ /** Performs the floor operation on a 32-bit float. */
+ export function floor(value: f32): f32;
+ /** Rounds to the nearest integer tied to even of a 32-bit float. */
+ export function nearest(value: f32): f32;
+ /** Reinterprets the bits of the specified 32-bit integer as a 32-bit float. */
+ export function reinterpret_i32(value: i32): f32;
+ /** Calculates the square root of a 32-bit float. */
+ export function sqrt(value: f32): f32;
+ /** Rounds to the nearest integer towards zero of a 32-bit float. */
+ export function trunc(value: f32): f32;
+}
+/** Converts any other numeric value to a 64-bit float. */
+declare function f64(value: any): f64;
+declare namespace f64 {
+ /** Smallest representable value. */
+ export const MIN_VALUE: f64;
+ /** Largest representable value. */
+ export const MAX_VALUE: f64;
+ /** Smallest normalized positive value. */
+ export const MIN_NORMAL_VALUE: f64;
+ /** Smallest safely representable integer value. */
+ export const MIN_SAFE_INTEGER: f64;
+ /** Largest safely representable integer value. */
+ export const MAX_SAFE_INTEGER: f64;
+ /** Positive infinity value. */
+ export const POSITIVE_INFINITY: f64;
+ /** Negative infinity value. */
+ export const NEGATIVE_INFINITY: f64;
+ /** Not a number value. */
+ export const NaN: f64;
+ /** Difference between 1 and the smallest representable value greater than 1. */
+ export const EPSILON: f64;
+ /** Loads a 64-bit float from memory. */
+ export function load(ptr: usize, immOffset?: usize, immAlign?: usize): f64;
+ /** Stores a 64-bit float to memory. */
+ export function store(
+ ptr: usize,
+ value: f64,
+ immOffset?: usize,
+ immAlign?: usize
+ ): void;
+ /** Computes the sum of two 64-bit floats. */
+ export function add(left: f64, right: f64): f64;
+ /** Computes the difference of two 64-bit floats. */
+ export function sub(left: f64, right: f64): f64;
+ /** Computes the product of two 64-bit floats. */
+ export function mul(left: f64, right: f64): f64;
+ /** Computes the quotient of two 64-bit floats. */
+ export function div(left: f64, right: f64): f64;
+ /** Computes the absolute value of a 64-bit float. */
+ export function abs(value: f64): f64;
+ /** Determines the maximum of two 64-bit floats. If either operand is `NaN`, returns `NaN`. */
+ export function max(left: f64, right: f64): f64;
+ /** Determines the minimum of two 64-bit floats. If either operand is `NaN`, returns `NaN`. */
+ export function min(left: f64, right: f64): f64;
+ /** Performs the ceiling operation on a 64-bit float. */
+ export function ceil(value: f64): f64;
+ /** Composes a 64-bit float from the magnitude of `x` and the sign of `y`. */
+ export function copysign(x: f64, y: f64): f64;
+ /** Performs the floor operation on a 64-bit float. */
+ export function floor(value: f64): f64;
+ /** Rounds to the nearest integer tied to even of a 64-bit float. */
+ export function nearest(value: f64): f64;
+ /** Reinterprets the bits of the specified 64-bit integer as a 64-bit float. */
+ export function reinterpret_i64(value: i64): f64;
+ /** Calculates the square root of a 64-bit float. */
+ export function sqrt(value: f64): f64;
+ /** Rounds to the nearest integer towards zero of a 64-bit float. */
+ export function trunc(value: f64): f64;
+}
+/** Initializes a 128-bit vector from sixteen 8-bit integer values. Arguments must be compile-time constants. */
+declare function v128(
+ a: i8,
+ b: i8,
+ c: i8,
+ d: i8,
+ e: i8,
+ f: i8,
+ g: i8,
+ h: i8,
+ i: i8,
+ j: i8,
+ k: i8,
+ l: i8,
+ m: i8,
+ n: i8,
+ o: i8,
+ p: i8
+): v128;
+declare namespace v128 {
+ /** Creates a vector with identical lanes. */
+ export function splat(x: T): v128;
+ /** Extracts one lane as a scalar. */
+ export function extract_lane(x: v128, idx: u8): T;
+ /** Replaces one lane. */
+ export function replace_lane(x: v128, idx: u8, value: T): v128;
+ /** Selects lanes from either vector according to the specified lane indexes. */
+ export function shuffle(a: v128, b: v128, ...lanes: u8[]): v128;
+ /** Selects 8-bit lanes from the first vector according to the indexes [0-15] specified by the 8-bit lanes of the second vector. */
+ export function swizzle(a: v128, s: v128): v128;
+ /** Loads a vector from memory. */
+ export function load(ptr: usize, immOffset?: usize, immAlign?: usize): v128;
+ /** Creates a vector by loading the lanes of the specified type and extending each to the next larger type. */
+ export function load_ext(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Creates a vector by loading a value of the specified type into the lowest bits and initializing all other bits of the vector to zero. */
+ export function load_zero(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Loads a single lane from memory into the specified lane of the given vector. Other lanes are bypassed as is. */
+ export function load_lane(
+ ptr: usize,
+ vec: v128,
+ idx: u8,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Stores the single lane at the specified index of the given vector to memory. */
+ export function store_lane(
+ ptr: usize,
+ vec: v128,
+ idx: u8,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Creates a vector with eight 16-bit integer lanes by loading and sign extending eight 8-bit integers. */
+ export function load8x8_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128;
+ /** Creates a vector with eight 16-bit integer lanes by loading and zero extending eight 8-bit integers. */
+ export function load8x8_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128;
+ /** Creates a vector with four 32-bit integer lanes by loading and sign extending four 16-bit integers. */
+ export function load16x4_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128;
+ /** Creates a vector with four 32-bit integer lanes by loading and zero extending four 16-bit integers. */
+ export function load16x4_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128;
+ /** Creates a vector with two 64-bit integer lanes by loading and sign extending two 32-bit integers. */
+ export function load32x2_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128;
+ /** Creates a vector with two 64-bit integer lanes by loading and zero extending two 32-bit integers. */
+ export function load32x2_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128;
+ /** Creates a vector with identical lanes by loading the splatted value. */
+ export function load_splat(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Loads an 8-bit integer and splats it sixteen times forming a new vector. */
+ export function load8_splat(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Loads a 16-bit integer and splats it eight times forming a new vector. */
+ export function load16_splat(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Loads a 32-bit integer and splats it four times forming a new vector. */
+ export function load32_splat(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Loads a 64-bit integer and splats it two times forming a new vector. */
+ export function load64_splat(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Creates a vector by loading a 32-bit value into the lowest bits and initializing all other bits of the vector to zero. */
+ export function load32_zero(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Creates a vector by loading a 64-bit value into the lowest bits and initializing all other bits of the vector to zero. */
+ export function load64_zero(
+ ptr: usize,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Loads a single 8-bit lane from memory into the specified lane of the given vector. Other lanes are bypassed as is. */
+ export function load8_lane(
+ ptr: usize,
+ vec: v128,
+ idx: u8,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Loads a single 16-bit lane from memory into the specified lane of the given vector. Other lanes are bypassed as is. */
+ export function load16_lane(
+ ptr: usize,
+ vec: v128,
+ idx: u8,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Loads a single 32-bit lane from memory into the specified lane of the given vector. Other lanes are bypassed as is. */
+ export function load32_lane(
+ ptr: usize,
+ vec: v128,
+ idx: u8,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Loads a single 64-bit lane from memory into the specified lane of the given vector. Other lanes are bypassed as is. */
+ export function load64_lane(
+ ptr: usize,
+ vec: v128,
+ idx: u8,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Stores the 8-bit lane at the specified lane of the given vector to memory. */
+ export function store8_lane(
+ ptr: usize,
+ vec: v128,
+ idx: u8,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Stores the 16-bit lane at the specified lane of the given vector to memory. */
+ export function store16_lane(
+ ptr: usize,
+ vec: v128,
+ idx: u8,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Stores the 32-bit lane at the specified lane of the given vector to memory. */
+ export function store32_lane(
+ ptr: usize,
+ vec: v128,
+ idx: u8,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Stores the 64-bit lane at the specified lane of the given vector to memory. */
+ export function store64_lane(
+ ptr: usize,
+ vec: v128,
+ idx: u8,
+ immOffset?: usize,
+ immAlign?: usize
+ ): v128;
+ /** Stores a vector to memory. */
+ export function store(
+ ptr: usize,
+ value: v128,
+ immOffset?: usize,
+ immAlign?: usize
+ ): void;
+ /** Adds each lane. */
+ export function add(a: v128, b: v128): v128;
+ /** Subtracts each lane. */
+ export function sub(a: v128, b: v128): v128;
+ /** Multiplies each lane. */
+ export function mul(a: v128, b: v128): v128; // except i64
+ /** Divides each lane. */
+ export function div(a: v128, b: v128): v128;
+ /** Negates each lane of a vector. */
+ export function neg(a: v128): v128;
+ /** Adds each lane using saturation. */
+ export function add_sat(a: v128, b: v128): v128;
+ /** Subtracts each lane using saturation. */
+ export function sub_sat(a: v128, b: v128): v128;
+ /** Performs a bitwise left shift on each lane of a vector by a scalar. */
+ export function shl(a: v128, b: i32): v128;
+ /** Performs a bitwise right shift on each lane of a vector by a scalar. */
+ export function shr(a: v128, b: i32): v128;
+ /** Performs the bitwise AND operation on two vectors. */
+ export function and(a: v128, b: v128): v128;
+ /** Performs the bitwise OR operation on two vectors. */
+ export function or(a: v128, b: v128): v128;
+ /** Performs the bitwise XOR operation on two vectors. */
+ export function xor(a: v128, b: v128): v128;
+ /** Performs the bitwise ANDNOT operation on two vectors. */
+ export function andnot(a: v128, b: v128): v128;
+ /** Performs the bitwise NOT operation on a vector. */
+ export function not(a: v128): v128;
+ /** Selects bits of either vector according to the specified mask. */
+ export function bitselect(v1: v128, v2: v128, mask: v128): v128;
+ /** Reduces a vector to a scalar indicating whether any lane is considered `true`. */
+ export function any_true(a: v128): bool;
+ /** Reduces a vector to a scalar indicating whether all lanes are considered `true`. */
+ export function all_true(a: v128): bool;
+ /** Extracts the high bit of each lane and produces a scalar mask with all bits concatenated. */
+ export function bitmask(a: v128): i32;
+ /** Counts the number of bits set to one within each lane. */
+ export function popcnt(a: v128): v128;
+ /** Computes the minimum of each lane. */
+ export function min(a: v128, b: v128): v128;
+ /** Computes the maximum of each lane. */
+ export function max(a: v128, b: v128): v128;
+ /** Computes the pseudo-minimum of each lane. */
+ export function pmin(a: v128, b: v128): v128;
+ /** Computes the pseudo-maximum of each lane. */
+ export function pmax(a: v128, b: v128): v128;
+ /** Computes the dot product of two lanes each, yielding lanes one size wider than the input. */
+ export function dot(a: v128, b: v128): v128;
+ /** Computes the average of each lane. */
+ export function avgr(a: v128, b: v128): v128;
+ /** Computes the absolute value of each lane. */
+ export function abs(a: v128): v128;
+ /** Computes the square root of each lane. */
+ export function sqrt(a: v128): v128;
+ /** Performs the ceiling operation on each lane. */
+ export function ceil(a: v128): v128;
+ /** Performs the floor operation on each lane. */
+ export function floor(a: v128): v128;
+ /** Rounds to the nearest integer towards zero of each lane. */
+ export function trunc(a: v128): v128;
+ /** Rounds to the nearest integer tied to even of each lane. */
+ export function nearest(a: v128): v128;
+ /** Computes which lanes are equal. */
+ export function eq(a: v128, b: v128): v128;
+ /** Computes which lanes are not equal. */
+ export function ne(a: v128, b: v128): v128;
+ /** Computes which lanes of the first vector are less than those of the second. */
+ export function lt(a: v128, b: v128): v128;
+ /** Computes which lanes of the first vector are less than or equal those of the second. */
+ export function le(a: v128, b: v128): v128;
+ /** Computes which lanes of the first vector are greater than those of the second. */
+ export function gt(a: v128, b: v128): v128;
+ /** Computes which lanes of the first vector are greater than or equal those of the second. */
+ export function ge(a: v128, b: v128): v128;
+ /** Converts each lane of a vector from integer to single-precision floating point. */
+ export function convert(a: v128): v128;
+ /** Converts the low lanes of a vector from integer to double-precision floating point. */
+ export function convert_low(a: v128): v128;
+ /** Truncates each lane of a vector from single-precision floating point to integer with saturation. Takes the target type. */
+ export function trunc_sat(a: v128): v128;
+ /** Truncates each lane of a vector from double-precision floating point to integer with saturation. Takes the target type. */
+ export function trunc_sat_zero(a: v128): v128;
+ /** Narrows each lane to their respective narrower lanes. */
+ export function narrow(a: v128, b: v128): v128;
+ /** Extends the low lanes of a vector to their respective wider lanes. */
+ export function extend_low(
+ a: v128
+ ): v128;
+ /** Extends the high lanes of a vector to their respective wider lanes. */
+ export function extend_high(
+ a: v128
+ ): v128;
+ /** Adds lanes pairwise producing twice wider extended results. */
+ export function extadd_pairwise(
+ a: v128
+ ): v128;
+ /** Demotes each float lane to lower precision. The higher lanes of the result are initialized to zero. */
+ export function demote_zero(a: v128): v128;
+ /** Promotes the lower float lanes to higher precision. */
+ export function promote_low(a: v128): v128;
+ /** Performs the line-wise saturating rounding multiplication in Q15 format. */
+ export function q15mulr_sat(a: v128, b: v128): v128;
+ /** Performs the lane-wise integer extended multiplication of the lower lanes producing a twice wider result than the inputs. */
+ export function extmul_low(
+ a: v128,
+ b: v128
+ ): v128;
+ /** Performs the lane-wise integer extended multiplication of the higher lanes producing a twice wider result than the inputs. */
+ export function extmul_high(
+ a: v128,
+ b: v128
+ ): v128;
+}
+/** Initializes a 128-bit vector from sixteen 8-bit integer values. Arguments must be compile-time constants. */
+declare function i8x16(
+ a: i8,
+ b: i8,
+ c: i8,
+ d: i8,
+ e: i8,
+ f: i8,
+ g: i8,
+ h: i8,
+ i: i8,
+ j: i8,
+ k: i8,
+ l: i8,
+ m: i8,
+ n: i8,
+ o: i8,
+ p: i8
+): v128;
+declare namespace i8x16 {
+ /** Creates a vector with sixteen identical 8-bit integer lanes. */
+ export function splat(x: i8): v128;
+ /** Extracts one 8-bit integer lane as a signed scalar. */
+ export function extract_lane_s(x: v128, idx: u8): i8;
+ /** Extracts one 8-bit integer lane as an unsigned scalar. */
+ export function extract_lane_u(x: v128, idx: u8): u8;
+ /** Replaces one 8-bit integer lane. */
+ export function replace_lane(x: v128, idx: u8, value: i8): v128;
+ /** Adds each 8-bit integer lane. */
+ export function add(a: v128, b: v128): v128;
+ /** Subtracts each 8-bit integer lane. */
+ export function sub(a: v128, b: v128): v128;
+ /** Computes the signed minimum of each 8-bit integer lane. */
+ export function min_s(a: v128, b: v128): v128;
+ /** Computes the unsigned minimum of each 8-bit integer lane. */
+ export function min_u(a: v128, b: v128): v128;
+ /** Computes the signed maximum of each 8-bit integer lane. */
+ export function max_s(a: v128, b: v128): v128;
+ /** Computes the unsigned maximum of each 8-bit integer lane. */
+ export function max_u(a: v128, b: v128): v128;
+ /** Computes the unsigned average of each 8-bit integer lane. */
+ export function avgr_u(a: v128, b: v128): v128;
+ /** Computes the absolute value of each 8-bit integer lane. */
+ export function abs(a: v128): v128;
+ /** Negates each 8-bit integer lane. */
+ export function neg(a: v128): v128;
+ /** Adds each 8-bit integer lane using signed saturation. */
+ export function add_sat_s(a: v128, b: v128): v128;
+ /** Adds each 8-bit integer lane using unsigned saturation. */
+ export function add_sat_u(a: v128, b: v128): v128;
+ /** Subtracts each 8-bit integer lane using signed saturation. */
+ export function sub_sat_s(a: v128, b: v128): v128;
+ /** Subtracts each 8-bit integer lane using unsigned saturation. */
+ export function sub_sat_u(a: v128, b: v128): v128;
+ /** Performs a bitwise left shift on each 8-bit integer lane by a scalar. */
+ export function shl(a: v128, b: i32): v128;
+ /** Performs a bitwise arithmetic right shift on each 8-bit integer lane by a scalar. */
+ export function shr_s(a: v128, b: i32): v128;
+ /** Performs a bitwise logical right shift on each 8-bit integer lane by a scalar. */
+ export function shr_u(a: v128, b: i32): v128;
+ /** Reduces a vector to a scalar indicating whether all 8-bit integer lanes are considered `true`. */
+ export function all_true(a: v128): bool;
+ /** Extracts the high bit of each 8-bit integer lane and produces a scalar mask with all bits concatenated. */
+ export function bitmask(a: v128): i32;
+ /** Counts the number of bits set to one within each 8-bit integer lane. */
+ export function popcnt(a: v128): v128;
+ /** Computes which 8-bit integer lanes are equal. */
+ export function eq(a: v128, b: v128): v128;
+ /** Computes which 8-bit integer lanes are not equal. */
+ export function ne(a: v128, b: v128): v128;
+ /** Computes which 8-bit signed integer lanes of the first vector are less than those of the second. */
+ export function lt_s(a: v128, b: v128): v128;
+ /** Computes which 8-bit unsigned integer lanes of the first vector are less than those of the second. */
+ export function lt_u(a: v128, b: v128): v128;
+ /** Computes which 8-bit signed integer lanes of the first vector are less than or equal those of the second. */
+ export function le_s(a: v128, b: v128): v128;
+ /** Computes which 8-bit unsigned integer lanes of the first vector are less than or equal those of the second. */
+ export function le_u(a: v128, b: v128): v128;
+ /** Computes which 8-bit signed integer lanes of the first vector are greater than those of the second. */
+ export function gt_s(a: v128, b: v128): v128;
+ /** Computes which 8-bit unsigned integer lanes of the first vector are greater than those of the second. */
+ export function gt_u(a: v128, b: v128): v128;
+ /** Computes which 8-bit signed integer lanes of the first vector are greater than or equal those of the second. */
+ export function ge_s(a: v128, b: v128): v128;
+ /** Computes which 8-bit unsigned integer lanes of the first vector are greater than or equal those of the second. */
+ export function ge_u(a: v128, b: v128): v128;
+ /** Narrows each 16-bit signed integer lane to 8-bit signed integer lanes. */
+ export function narrow_i16x8_s(a: v128, b: v128): v128;
+ /** Narrows each 16-bit signed integer lane to 8-bit unsigned integer lanes. */
+ export function narrow_i16x8_u(a: v128, b: v128): v128;
+ /** Selects 8-bit lanes from either vector according to the specified [0-15] respectively [16-31] lane indexes. */
+ export function shuffle(
+ a: v128,
+ b: v128,
+ l0: u8,
+ l1: u8,
+ l2: u8,
+ l3: u8,
+ l4: u8,
+ l5: u8,
+ l6: u8,
+ l7: u8,
+ l8: u8,
+ l9: u8,
+ l10: u8,
+ l11: u8,
+ l12: u8,
+ l13: u8,
+ l14: u8,
+ l15: u8
+ ): v128;
+ /** Selects 8-bit lanes from the first vector according to the indexes [0-15] specified by the 8-bit lanes of the second vector. */
+ export function swizzle(a: v128, s: v128): v128;
+}
+/** Initializes a 128-bit vector from eight 16-bit integer values. Arguments must be compile-time constants. */
+declare function i16x8(
+ a: i16,
+ b: i16,
+ c: i16,
+ d: i16,
+ e: i16,
+ f: i16,
+ g: i16,
+ h: i16
+): v128;
+declare namespace i16x8 {
+ /** Creates a vector with eight identical 16-bit integer lanes. */
+ export function splat(x: i16): v128;
+ /** Extracts one 16-bit integer lane as a signed scalar. */
+ export function extract_lane_s(x: v128, idx: u8): i16;
+ /** Extracts one 16-bit integer lane as an unsigned scalar. */
+ export function extract_lane_u(x: v128, idx: u8): u16;
+ /** Replaces one 16-bit integer lane. */
+ export function replace_lane(x: v128, idx: u8, value: i16): v128;
+ /** Adds each 16-bit integer lane. */
+ export function add(a: v128, b: v128): v128;
+ /** Subtracts each 16-bit integer lane. */
+ export function sub(a: v128, b: v128): v128;
+ /** Multiplies each 16-bit integer lane. */
+ export function mul(a: v128, b: v128): v128;
+ /** Computes the signed minimum of each 16-bit integer lane. */
+ export function min_s(a: v128, b: v128): v128;
+ /** Computes the unsigned minimum of each 16-bit integer lane. */
+ export function min_u(a: v128, b: v128): v128;
+ /** Computes the signed maximum of each 16-bit integer lane. */
+ export function max_s(a: v128, b: v128): v128;
+ /** Computes the unsigned maximum of each 16-bit integer lane. */
+ export function max_u(a: v128, b: v128): v128;
+ /** Computes the unsigned average of each 16-bit integer lane. */
+ export function avgr_u(a: v128, b: v128): v128;
+ /** Computes the absolute value of each 16-bit integer lane. */
+ export function abs(a: v128): v128;
+ /** Negates each 16-bit integer lane. */
+ export function neg(a: v128): v128;
+ /** Adds each 16-bit integer lane using signed saturation. */
+ export function add_sat_s(a: v128, b: v128): v128;
+ /** Adds each 16-bit integer lane using unsigned saturation. */
+ export function add_sat_u(a: v128, b: v128): v128;
+ /** Subtracts each 16-bit integer lane using signed saturation. */
+ export function sub_sat_s(a: v128, b: v128): v128;
+ /** Subtracts each 16-bit integer lane using unsigned saturation. */
+ export function sub_sat_u(a: v128, b: v128): v128;
+ /** Performs a bitwise left shift on each 16-bit integer lane by a scalar. */
+ export function shl(a: v128, b: i32): v128;
+ /** Performs a bitwise arithmetic right shift each 16-bit integer lane by a scalar. */
+ export function shr_s(a: v128, b: i32): v128;
+ /** Performs a bitwise logical right shift on each 16-bit integer lane by a scalar. */
+ export function shr_u(a: v128, b: i32): v128;
+ /** Reduces a vector to a scalar indicating whether all 16-bit integer lanes are considered `true`. */
+ export function all_true(a: v128): bool;
+ /** Extracts the high bit of each 16-bit integer lane and produces a scalar mask with all bits concatenated. */
+ export function bitmask(a: v128): i32;
+ /** Computes which 16-bit integer lanes are equal. */
+ export function eq(a: v128, b: v128): v128;
+ /** Computes which 16-bit integer lanes are not equal. */
+ export function ne(a: v128, b: v128): v128;
+ /** Computes which 16-bit signed integer lanes of the first vector are less than those of the second. */
+ export function lt_s(a: v128, b: v128): v128;
+ /** Computes which 16-bit unsigned integer lanes of the first vector are less than those of the second. */
+ export function lt_u(a: v128, b: v128): v128;
+ /** Computes which 16-bit signed integer lanes of the first vector are less than or equal those of the second. */
+ export function le_s(a: v128, b: v128): v128;
+ /** Computes which 16-bit unsigned integer lanes of the first vector are less than or equal those of the second. */
+ export function le_u(a: v128, b: v128): v128;
+ /** Computes which 16-bit signed integer lanes of the first vector are greater than those of the second. */
+ export function gt_s(a: v128, b: v128): v128;
+ /** Computes which 16-bit unsigned integer lanes of the first vector are greater than those of the second. */
+ export function gt_u(a: v128, b: v128): v128;
+ /** Computes which 16-bit signed integer lanes of the first vector are greater than or equal those of the second. */
+ export function ge_s(a: v128, b: v128): v128;
+ /** Computes which 16-bit unsigned integer lanes of the first vector are greater than or equal those of the second. */
+ export function ge_u(a: v128, b: v128): v128;
+ /** Narrows each 32-bit signed integer lane to 16-bit signed integer lanes. */
+ export function narrow_i32x4_s(a: v128, b: v128): v128;
+ /** Narrows each 32-bit signed integer lane to 16-bit unsigned integer lanes. */
+ export function narrow_i32x4_u(a: v128, b: v128): v128;
+ /** Extends the low 8-bit signed integer lanes to 16-bit signed integer lanes. */
+ export function extend_low_i8x16_s(a: v128): v128;
+ /** Extends the low 8-bit unsigned integer lanes to 16-bit unsigned integer lanes. */
+ export function extend_low_i8x16_u(a: v128): v128;
+ /** Extends the high 8-bit signed integer lanes to 16-bit signed integer lanes. */
+ export function extend_high_i8x16_s(a: v128): v128;
+ /** Extends the high 8-bit unsigned integer lanes to 16-bit unsigned integer lanes. */
+ export function extend_high_i8x16_u(a: v128): v128;
+ /** Adds the sixteen 8-bit signed integer lanes pairwise producing eight 16-bit signed integer results. */
+ export function extadd_pairwise_i8x16_s(a: v128): v128;
+ /** Adds the sixteen 8-bit unsigned integer lanes pairwise producing eight 16-bit unsigned integer results. */
+ export function extadd_pairwise_i8x16_u(a: v128): v128;
+ /** Performs the line-wise 16-bit signed integer saturating rounding multiplication in Q15 format. */
+ export function q15mulr_sat_s(a: v128, b: v128): v128;
+ /** Performs the lane-wise 8-bit signed integer extended multiplication of the eight lower lanes producing twice wider 16-bit integer results. */
+ export function extmul_low_i8x16_s(a: v128, b: v128): v128;
+ /** Performs the lane-wise 8-bit unsigned integer extended multiplication of the eight lower lanes producing twice wider 16-bit integer results. */
+ export function extmul_low_i8x16_u(a: v128, b: v128): v128;
+ /** Performs the lane-wise 8-bit signed integer extended multiplication of the eight higher lanes producing twice wider 16-bit integer results. */
+ export function extmul_high_i8x16_s(a: v128, b: v128): v128;
+ /** Performs the lane-wise 8-bit unsigned integer extended multiplication of the eight higher lanes producing twice wider 16-bit integer results. */
+ export function extmul_high_i8x16_u(a: v128, b: v128): v128;
+}
+/** Initializes a 128-bit vector from four 32-bit integer values. Arguments must be compile-time constants. */
+declare function i32x4(a: i32, b: i32, c: i32, d: i32): v128;
+declare namespace i32x4 {
+ /** Creates a vector with four identical 32-bit integer lanes. */
+ export function splat(x: i32): v128;
+ /** Extracts one 32-bit integer lane as a scalar. */
+ export function extract_lane(x: v128, idx: u8): i32;
+ /** Replaces one 32-bit integer lane. */
+ export function replace_lane(x: v128, idx: u8, value: i32): v128;
+ /** Adds each 32-bit integer lane. */
+ export function add(a: v128, b: v128): v128;
+ /** Subtracts each 32-bit integer lane. */
+ export function sub(a: v128, b: v128): v128;
+ /** Multiplies each 32-bit integer lane. */
+ export function mul(a: v128, b: v128): v128;
+ /** Computes the signed minimum of each 32-bit integer lane. */
+ export function min_s(a: v128, b: v128): v128;
+ /** Computes the unsigned minimum of each 32-bit integer lane. */
+ export function min_u(a: v128, b: v128): v128;
+ /** Computes the signed maximum of each 32-bit integer lane. */
+ export function max_s(a: v128, b: v128): v128;
+ /** Computes the unsigned maximum of each 32-bit integer lane. */
+ export function max_u(a: v128, b: v128): v128;
+ /** Computes the dot product of two 16-bit integer lanes each, yielding 32-bit integer lanes. */
+ export function dot_i16x8_s(a: v128, b: v128): v128;
+ /** Computes the absolute value of each 32-bit integer lane. */
+ export function abs(a: v128): v128;
+ /** Negates each 32-bit integer lane. */
+ export function neg(a: v128): v128;
+ /** Performs a bitwise left shift on each 32-bit integer lane by a scalar. */
+ export function shl(a: v128, b: i32): v128;
+ /** Performs a bitwise arithmetic right shift on each 32-bit integer lane by a scalar. */
+ export function shr_s(a: v128, b: i32): v128;
+ /** Performs a bitwise logical right shift on each 32-bit integer lane by a scalar. */
+ export function shr_u(a: v128, b: i32): v128;
+ /** Reduces a vector to a scalar indicating whether all 32-bit integer lanes are considered `true`. */
+ export function all_true(a: v128): bool;
+ /** Extracts the high bit of each 32-bit integer lane and produces a scalar mask with all bits concatenated. */
+ export function bitmask(a: v128): i32;
+ /** Computes which 32-bit integer lanes are equal. */
+ export function eq(a: v128, b: v128): v128;
+ /** Computes which 32-bit integer lanes are not equal. */
+ export function ne(a: v128, b: v128): v128;
+ /** Computes which 32-bit signed integer lanes of the first vector are less than those of the second. */
+ export function lt_s(a: v128, b: v128): v128;
+ /** Computes which 32-bit unsigned integer lanes of the first vector are less than those of the second. */
+ export function lt_u(a: v128, b: v128): v128;
+ /** Computes which 32-bit signed integer lanes of the first vector are less than or equal those of the second. */
+ export function le_s(a: v128, b: v128): v128;
+ /** Computes which 32-bit unsigned integer lanes of the first vector are less than or equal those of the second. */
+ export function le_u(a: v128, b: v128): v128;
+ /** Computes which 32-bit signed integer lanes of the first vector are greater than those of the second. */
+ export function gt_s(a: v128, b: v128): v128;
+ /** Computes which 32-bit unsigned integer lanes of the first vector are greater than those of the second. */
+ export function gt_u(a: v128, b: v128): v128;
+ /** Computes which 32-bit signed integer lanes of the first vector are greater than or equal those of the second. */
+ export function ge_s(a: v128, b: v128): v128;
+ /** Computes which 32-bit unsigned integer lanes of the first vector are greater than or equal those of the second. */
+ export function ge_u(a: v128, b: v128): v128;
+ /** Truncates each 32-bit float lane to a signed integer with saturation. */
+ export function trunc_sat_f32x4_s(a: v128): v128;
+ /** Truncates each 32-bit float lane to an unsigned integer with saturation. */
+ export function trunc_sat_f32x4_u(a: v128): v128;
+ /** Truncates the two 64-bit float lanes to the two lower signed integer lanes with saturation. The two higher integer lanes of the result are initialized to zero. */
+ export function trunc_sat_f64x2_s_zero(a: v128): v128;
+ /** Truncates the two 64-bit float lanes to the two lower unsigned integer lanes with saturation. The two higher integer lanes of the result are initialized to zero. */
+ export function trunc_sat_f64x2_u_zero(a: v128): v128;
+ /** Extends the low 16-bit signed integer lanes to 32-bit signed integer lanes. */
+ export function extend_low_i16x8_s(a: v128): v128;
+ /** Extends the low 16-bit unsigned integer lane to 32-bit unsigned integer lanes. */
+ export function extend_low_i16x8_u(a: v128): v128;
+ /** Extends the high 16-bit signed integer lanes to 32-bit signed integer lanes. */
+ export function extend_high_i16x8_s(a: v128): v128;
+ /** Extends the high 16-bit unsigned integer lanes to 32-bit unsigned integer lanes. */
+ export function extend_high_i16x8_u(a: v128): v128;
+ /** Adds the eight 16-bit signed integer lanes pairwise producing four 32-bit signed integer results. */
+ export function extadd_pairwise_i16x8_s(a: v128): v128;
+ /** Adds the eight 16-bit unsigned integer lanes pairwise producing four 32-bit unsigned integer results. */
+ export function extadd_pairwise_i16x8_u(a: v128): v128;
+ /** Performs the lane-wise 16-bit signed integer extended multiplication of the four lower lanes producing twice wider 32-bit integer results. */
+ export function extmul_low_i16x8_s(a: v128, b: v128): v128;
+ /** Performs the lane-wise 16-bit unsigned integer extended multiplication of the four lower lanes producing twice wider 32-bit integer results. */
+ export function extmul_low_i16x8_u(a: v128, b: v128): v128;
+ /** Performs the lane-wise 16-bit signed integer extended multiplication of the four higher lanes producing twice wider 32-bit integer results. */
+ export function extmul_high_i16x8_s(a: v128, b: v128): v128;
+ /** Performs the lane-wise 16-bit unsigned integer extended multiplication of the four higher lanes producing twice wider 32-bit integer results. */
+ export function extmul_high_i16x8_u(a: v128, b: v128): v128;
+}
+/** Initializes a 128-bit vector from two 64-bit integer values. Arguments must be compile-time constants. */
+declare function i64x2(a: i64, b: i64): v128;
+declare namespace i64x2 {
+ /** Creates a vector with two identical 64-bit integer lanes. */
+ export function splat(x: i64): v128;
+ /** Extracts one 64-bit integer lane as a scalar. */
+ export function extract_lane(x: v128, idx: u8): i64;
+ /** Replaces one 64-bit integer lane. */
+ export function replace_lane(x: v128, idx: u8, value: i64): v128;
+ /** Adds each 64-bit integer lane. */
+ export function add(a: v128, b: v128): v128;
+ /** Subtracts each 64-bit integer lane. */
+ export function sub(a: v128, b: v128): v128;
+ /** Multiplies each 64-bit integer lane. */
+ export function mul(a: v128, b: v128): v128;
+ /** Computes the absolute value of each 64-bit integer lane. */
+ export function abs(a: v128): v128;
+ /** Negates each 64-bit integer lane. */
+ export function neg(a: v128): v128;
+ /** Performs a bitwise left shift on each 64-bit integer lane by a scalar. */
+ export function shl(a: v128, b: i32): v128;
+ /** Performs a bitwise arithmetic right shift on each 64-bit integer lane by a scalar. */
+ export function shr_s(a: v128, b: i32): v128;
+ /** Performs a bitwise logical right shift on each 64-bit integer lane by a scalar. */
+ export function shr_u(a: v128, b: i32): v128;
+ /** Reduces a vector to a scalar indicating whether all 64-bit integer lanes are considered `true`. */
+ export function all_true(a: v128): bool;
+ /** Extracts the high bit of each 64-bit integer lane and produces a scalar mask with all bits concatenated. */
+ export function bitmask(a: v128): i32;
+ /** Computes which 64-bit integer lanes are equal. */
+ export function eq(a: v128, b: v128): v128;
+ /** Computes which 64-bit integer lanes are not equal. */
+ export function ne(a: v128, b: v128): v128;
+ /** Computes which 64-bit signed integer lanes of the first vector are less than those of the second. */
+ export function lt_s(a: v128, b: v128): v128;
+ /** Computes which 64-bit signed integer lanes of the first vector are less than or equal those of the second. */
+ export function le_s(a: v128, b: v128): v128;
+ /** Computes which 64-bit signed integer lanes of the first vector are greater than those of the second. */
+ export function gt_s(a: v128, b: v128): v128;
+ /** Computes which 64-bit signed integer lanes of the first vector are greater than or equal those of the second. */
+ export function ge_s(a: v128, b: v128): v128;
+ /** Extends the low 32-bit signed integer lanes to 64-bit signed integer lanes. */
+ export function extend_low_i32x4_s(a: v128): v128;
+ /** Extends the low 32-bit unsigned integer lane to 64-bit unsigned integer lanes. */
+ export function extend_low_i32x4_u(a: v128): v128;
+ /** Extends the high 32-bit signed integer lanes to 64-bit signed integer lanes. */
+ export function extend_high_i32x4_s(a: v128): v128;
+ /** Extends the high 32-bit unsigned integer lanes to 64-bit unsigned integer lanes. */
+ export function extend_high_i32x4_u(a: v128): v128;
+ /** Performs the lane-wise 32-bit signed integer extended multiplication of the two lower lanes producing twice wider 64-bit integer results. */
+ export function extmul_low_i32x4_s(a: v128, b: v128): v128;
+ /** Performs the lane-wise 32-bit unsigned integer extended multiplication of the two lower lanes producing twice wider 64-bit integer results. */
+ export function extmul_low_i32x4_u(a: v128, b: v128): v128;
+ /** Performs the lane-wise 32-bit signed integer extended multiplication of the two higher lanes producing twice wider 64-bit integer results. */
+ export function extmul_high_i32x4_s(a: v128, b: v128): v128;
+ /** Performs the lane-wise 32-bit unsigned integer extended multiplication of the two higher lanes producing twice wider 64-bit integer results. */
+ export function extmul_high_i32x4_u(a: v128, b: v128): v128;
+}
+/** Initializes a 128-bit vector from four 32-bit float values. Arguments must be compile-time constants. */
+declare function f32x4(a: f32, b: f32, c: f32, d: f32): v128;
+declare namespace f32x4 {
+ /** Creates a vector with four identical 32-bit float lanes. */
+ export function splat(x: f32): v128;
+ /** Extracts one 32-bit float lane as a scalar. */
+ export function extract_lane(x: v128, idx: u8): f32;
+ /** Replaces one 32-bit float lane. */
+ export function replace_lane(x: v128, idx: u8, value: f32): v128;
+ /** Adds each 32-bit float lane. */
+ export function add(a: v128, b: v128): v128;
+ /** Subtracts each 32-bit float lane. */
+ export function sub(a: v128, b: v128): v128;
+ /** Multiplies each 32-bit float lane. */
+ export function mul(a: v128, b: v128): v128;
+ /** Divides each 32-bit float lane. */
+ export function div(a: v128, b: v128): v128;
+ /** Negates each 32-bit float lane. */
+ export function neg(a: v128): v128;
+ /** Computes the minimum of each 32-bit float lane. */
+ export function min(a: v128, b: v128): v128;
+ /** Computes the maximum of each 32-bit float lane. */
+ export function max(a: v128, b: v128): v128;
+ /** Computes the pseudo-minimum of each 32-bit float lane. */
+ export function pmin(a: v128, b: v128): v128;
+ /** Computes the pseudo-maximum of each 32-bit float lane. */
+ export function pmax(a: v128, b: v128): v128;
+ /** Computes the absolute value of each 32-bit float lane. */
+ export function abs(a: v128): v128;
+ /** Computes the square root of each 32-bit float lane. */
+ export function sqrt(a: v128): v128;
+ /** Performs the ceiling operation on each 32-bit float lane. */
+ export function ceil(a: v128): v128;
+ /** Performs the floor operation on each each 32-bit float lane. */
+ export function floor(a: v128): v128;
+ /** Rounds to the nearest integer towards zero of each 32-bit float lane. */
+ export function trunc(a: v128): v128;
+ /** Rounds to the nearest integer tied to even of each 32-bit float lane. */
+ export function nearest(a: v128): v128;
+ /** Computes which 32-bit float lanes are equal. */
+ export function eq(a: v128, b: v128): v128;
+ /** Computes which 32-bit float lanes are not equal. */
+ export function ne(a: v128, b: v128): v128;
+ /** Computes which 32-bit float lanes of the first vector are less than those of the second. */
+ export function lt(a: v128, b: v128): v128;
+ /** Computes which 32-bit float lanes of the first vector are less than or equal those of the second. */
+ export function le(a: v128, b: v128): v128;
+ /** Computes which 32-bit float lanes of the first vector are greater than those of the second. */
+ export function gt(a: v128, b: v128): v128;
+ /** Computes which 32-bit float lanes of the first vector are greater than or equal those of the second. */
+ export function ge(a: v128, b: v128): v128;
+ /** Converts each 32-bit signed integer lane of a vector to single-precision floating point. */
+ export function convert_i32x4_s(a: v128): v128;
+ /** Converts each 32-bit unsigned integer lane of a vector to single-precision floating point. */
+ export function convert_i32x4_u(a: v128): v128;
+ /** Demotes each 64-bit float lane of a vector to single-precision. The higher lanes of the result are initialized to zero. */
+ export function demote_f64x2_zero(a: v128): v128;
+}
+/** Initializes a 128-bit vector from two 64-bit float values. Arguments must be compile-time constants. */
+declare function f64x2(a: f64, b: f64): v128;
+declare namespace f64x2 {
+ /** Creates a vector with two identical 64-bit float lanes. */
+ export function splat(x: f64): v128;
+ /** Extracts one 64-bit float lane as a scalar. */
+ export function extract_lane(x: v128, idx: u8): f64;
+ /** Replaces one 64-bit float lane. */
+ export function replace_lane(x: v128, idx: u8, value: f64): v128;
+ /** Adds each 64-bit float lane. */
+ export function add(a: v128, b: v128): v128;
+ /** Subtracts each 64-bit float lane. */
+ export function sub(a: v128, b: v128): v128;
+ /** Multiplies each 64-bit float lane. */
+ export function mul(a: v128, b: v128): v128;
+ /** Divides each 64-bit float lane. */
+ export function div(a: v128, b: v128): v128;
+ /** Negates each 64-bit float lane. */
+ export function neg(a: v128): v128;
+ /** Computes the minimum of each 64-bit float lane. */
+ export function min(a: v128, b: v128): v128;
+ /** Computes the maximum of each 64-bit float lane. */
+ export function max(a: v128, b: v128): v128;
+ /** Computes the pseudo-minimum of each 64-bit float lane. */
+ export function pmin(a: v128, b: v128): v128;
+ /** Computes the pseudo-maximum of each 64-bit float lane. */
+ export function pmax(a: v128, b: v128): v128;
+ /** Computes the absolute value of each 64-bit float lane. */
+ export function abs(a: v128): v128;
+ /** Computes the square root of each 64-bit float lane. */
+ export function sqrt(a: v128): v128;
+ /** Performs the ceiling operation on each 64-bit float lane. */
+ export function ceil(a: v128): v128;
+ /** Performs the floor operation on each each 64-bit float lane. */
+ export function floor(a: v128): v128;
+ /** Rounds to the nearest integer towards zero of each 64-bit float lane. */
+ export function trunc(a: v128): v128;
+ /** Rounds to the nearest integer tied to even of each 64-bit float lane. */
+ export function nearest(a: v128): v128;
+ /** Computes which 64-bit float lanes are equal. */
+ export function eq(a: v128, b: v128): v128;
+ /** Computes which 64-bit float lanes are not equal. */
+ export function ne(a: v128, b: v128): v128;
+ /** Computes which 64-bit float lanes of the first vector are less than those of the second. */
+ export function lt(a: v128, b: v128): v128;
+ /** Computes which 64-bit float lanes of the first vector are less than or equal those of the second. */
+ export function le(a: v128, b: v128): v128;
+ /** Computes which 64-bit float lanes of the first vector are greater than those of the second. */
+ export function gt(a: v128, b: v128): v128;
+ /** Computes which 64-bit float lanes of the first vector are greater than or equal those of the second. */
+ export function ge(a: v128, b: v128): v128;
+ /** Converts the low 32-bit signed integer lanes of a vector to double-precision floating point. */
+ export function convert_low_i32x4_s(a: v128): v128;
+ /** Converts the low 32-bit unsigned integer lanes of a vector to double-precision floating point. */
+ export function convert_low_i32x4_u(a: v128): v128;
+ /** Promotes the low 32-bit float lanes of a vector to double-precision. */
+ export function promote_low_f32x4(a: v128): v128;
+}
+
+declare abstract class i31 {
+ /** Creates a new i31ref from the specified integer value. */
+ static new(value: i32): i31ref;
+ /** Gets the integer value of an i31ref. */
+ static get(i31expr: i31ref): i32;
+}
+
+/** Macro type evaluating to the underlying native WebAssembly type. */
+declare type native = T;
+/** Special type evaluating the indexed access index type. */
+declare type indexof = keyof T;
+/** Special type evaluating the indexed access value type. */
+declare type valueof = T[0];
+/** A special type evaluated to the return type of T if T is a callable function. */
+declare type ReturnType any> = T extends (
+ ...args: any
+) => infer R
+ ? R
+ : any;
+/** A special type evaluated to the return type of T if T is a callable function. */
+declare type returnof any> = ReturnType;
+/** A special type that excludes null and undefined from T. */
+declare type NonNullable = T extends null | undefined ? never : T;
+/** A special type that excludes null and undefined from T. */
+declare type nonnull = NonNullable;
+
+/** Pseudo-class representing the backing class of integer types. */
+/** @internal */
+declare class _Integer {
+ /** Smallest representable value. */
+ static readonly MIN_VALUE: number;
+ /** Largest representable value. */
+ static readonly MAX_VALUE: number;
+ /** Converts a string to an integer of this type. */
+ static parseInt(value: string, radix?: number): number;
+ /** Converts this integer to a string. */
+ toString(radix?: number): string;
+}
+
+/** Pseudo-class representing the backing class of floating-point types. */
+/** @internal */
+declare class _Float {
+ /** Difference between 1 and the smallest representable value greater than 1. */
+ static readonly EPSILON: f32 | f64;
+ /** Smallest representable value. */
+ static readonly MIN_VALUE: f32 | f64;
+ /** Largest representable value. */
+ static readonly MAX_VALUE: f32 | f64;
+ /** Smallest safely representable integer value. */
+ static readonly MIN_SAFE_INTEGER: f32 | f64;
+ /** Largest safely representable integer value. */
+ static readonly MAX_SAFE_INTEGER: f32 | f64;
+ /** Value representing positive infinity. */
+ static readonly POSITIVE_INFINITY: f32 | f64;
+ /** Value representing negative infinity. */
+ static readonly NEGATIVE_INFINITY: f32 | f64;
+ /** Value representing 'not a number'. */
+ static readonly NaN: f32 | f64;
+ /** Returns a boolean value that indicates whether a value is the reserved value NaN (not a number). */
+ static isNaN(value: f32 | f64): bool;
+ /** Returns true if passed value is finite. */
+ static isFinite(value: f32 | f64): bool;
+ /** Returns true if the value passed is a safe integer. */
+ static isSafeInteger(value: f32 | f64): bool;
+ /** Returns true if the value passed is an integer, false otherwise. */
+ static isInteger(value: f32 | f64): bool;
+ /** Converts a string to an integer. */
+ static parseInt(value: string, radix?: i32): f32 | f64;
+ /** Converts a string to a floating-point number. */
+ static parseFloat(value: string): f32 | f64;
+ /** Converts this floating-point number to a string. */
+ toString(radix?: number): string;
+}
+
+/** Backing class of signed 8-bit integers. */
+declare const I8: typeof _Integer;
+/** Backing class of signed 16-bit integers. */
+declare const I16: typeof _Integer;
+/** Backing class of signed 32-bit integers. */
+declare const I32: typeof _Integer;
+/** Backing class of signed 64-bit integers. */
+declare const I64: typeof _Integer;
+/** Backing class of signed size integers. */
+declare const Isize: typeof _Integer;
+/** Backing class of unsigned 8-bit integers. */
+declare const U8: typeof _Integer;
+/** Backing class of unsigned 16-bit integers. */
+declare const U16: typeof _Integer;
+/** Backing class of unsigned 32-bit integers. */
+declare const U32: typeof _Integer;
+/** Backing class of unsigned 64-bit integers. */
+declare const U64: typeof _Integer;
+/** Backing class of unsigned size integers. */
+declare const Usize: typeof _Integer;
+/** Backing class of 32-bit floating-point values. */
+declare const F32: typeof _Float;
+/** Backing class of 64-bit floating-point values. */
+declare const F64: typeof _Float;
+
+// User-defined diagnostic macros
+
+/** Emits a user-defined diagnostic error when encountered. */
+declare function ERROR(message?: any): never;
+/** Emits a user-defined diagnostic warning when encountered. */
+declare function WARNING(message?: any): void;
+/** Emits a user-defined diagnostic info when encountered. */
+declare function INFO(message?: any): void;
+
+// Polyfills
+
+/** Performs the sign-agnostic reverse bytes **/
+declare function bswap<
+ T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64 | isize | usize
+>(value: T): T;
+/** Performs the sign-agnostic reverse bytes only for last 16-bit **/
+declare function bswap16(
+ value: T
+): T;
+
+// Standard library
+
+/** Memory operations. */
+declare namespace memory {
+ /** Whether the memory managed interface is implemented. */
+ export const implemented: bool;
+ /** Returns the current memory size in units of pages. One page is 64kb. */
+ export function size(): i32;
+ /** Grows linear memory by a given unsigned delta of pages. One page is 64kb. Returns the previous memory size in units of pages or `-1` on failure. */
+ export function grow(value: i32): i32;
+ /** Sets n bytes beginning at the specified destination in memory to the specified byte value. */
+ export function fill(dst: usize, value: u8, count: usize): void;
+ /** Copies n bytes from the specified source to the specified destination in memory. These regions may overlap. */
+ export function copy(dst: usize, src: usize, n: usize): void;
+ /** Repeats `src` of length `srcLength` `count` times at `dst`. */
+ export function repeat(
+ dst: usize,
+ src: usize,
+ srcLength: usize,
+ count: usize
+ ): void;
+ /** Copies elements from a passive element segment to a table. */
+ export function init(
+ segmentIndex: u32,
+ srcOffset: usize,
+ dstOffset: usize,
+ n: usize
+ ): void;
+ /** Prevents further use of a passive element segment. */
+ export function drop(segmentIndex: u32): void;
+ /** Compares two chunks of memory. Returns `0` if equal, otherwise the difference of the first differing bytes. */
+ export function compare(vl: usize, vr: usize, n: usize): i32;
+ /** Gets a pointer to a zeroed static chunk of memory of the given size. Alignment defaults to `16`. Arguments must be compile-time constants. */
+ export function data(size: i32, align?: i32): usize;
+ /** Gets a pointer to a pre-initialized static chunk of memory. Alignment defaults to the size of `T`. Arguments must be compile-time constants. */
+ export function data(values: T[], align?: i32): usize;
+}
+
+/** Heap memory interface. */
+declare namespace heap {
+ /** Allocates a chunk of memory of at least the specified size. */
+ export function alloc(size: usize): usize;
+ /** Reallocates a chunk of memory to have at least the specified size. */
+ export function realloc(ptr: usize, size: usize): usize;
+ /** Frees a chunk of memory. Does hardly anything (most recent block only) with the stub/none runtime. */
+ export function free(ptr: usize): void;
+}
+
+/** Table operations. */
+declare namespace table {
+ /** Copies elements from a passive element segment to a table. */
+ export function init(
+ elementIndex: u32,
+ srcOffset: u32,
+ dstOffset: u32,
+ n: u32
+ ): void;
+ /** Prevents further use of a passive element segment. */
+ export function drop(elementIndex: u32): void;
+ /** Copies elements from one region of a table to another region. */
+ export function copy(dest: u32, src: u32, n: u32): void;
+}
+
+declare namespace Atomics {
+ export function load(
+ array: TypedArray,
+ index: i32
+ ): T;
+ export function store(
+ array: TypedArray,
+ index: i32,
+ value: T
+ ): void;
+ export function add(
+ array: TypedArray,
+ index: i32,
+ value: T
+ ): T;
+ export function sub(
+ array: TypedArray,
+ index: i32,
+ value: T
+ ): T;
+ export function and(
+ array: TypedArray,
+ index: i32,
+ value: T
+ ): T;
+ export function or(
+ array: TypedArray,
+ index: i32,
+ value: T
+ ): T;
+ export function xor(
+ array: TypedArray,
+ index: i32,
+ value: T
+ ): T;
+ export function exchange<
+ T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64
+ >(array: TypedArray, index: i32, value: T): T;
+ export function compareExchange<
+ T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64
+ >(array: TypedArray, index: i32, expectedValue: T, replacementValue: T): T;
+ export function wait(
+ array: TypedArray,
+ value: T,
+ timeout?: i64
+ ): AtomicWaitResult;
+ export function notify(
+ array: TypedArray,
+ index: i32,
+ count?: i32
+ ): i32;
+ /** The static Atomics.isLockFree() method is used to determine whether to use locks or atomic operations. It returns true, if the given size is one of the BYTES_PER_ELEMENT */
+ export function isLockFree(size: usize): bool;
+}
+
+/** Class representing a generic, fixed-length raw binary data buffer. */
+declare class ArrayBuffer {
+ /** The size, in bytes, of the array. */
+ readonly byteLength: i32;
+ /** Returns true if value is one of the ArrayBuffer views, such as typed array or a DataView **/
+ static isView(value: T): bool;
+ /** Constructs a new array buffer of the given length in bytes. */
+ constructor(length: i32);
+ /** Returns a copy of this array buffer's bytes from begin, inclusive, up to end, exclusive. */
+ slice(begin?: i32, end?: i32): ArrayBuffer;
+ /** Returns a string representation of ArrayBuffer. */
+ toString(): string;
+}
+
+/** The `DataView` view provides a low-level interface for reading and writing multiple number types in a binary `ArrayBuffer`, without having to care about the platform's endianness. */
+declare class DataView {
+ /** The `buffer` accessor property represents the `ArrayBuffer` or `SharedArrayBuffer` referenced by the `DataView` at construction time. */
+ readonly buffer: ArrayBuffer;
+ /** The `byteLength` accessor property represents the length (in bytes) of this view from the start of its `ArrayBuffer` or `SharedArrayBuffer`. */
+ readonly byteLength: i32;
+ /** The `byteOffset` accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer` or `SharedArrayBuffer`. */
+ readonly byteOffset: i32;
+ /** Constructs a new `DataView` with the given properties */
+ constructor(buffer: ArrayBuffer, byteOffset?: i32, byteLength?: i32);
+ /** The `getFloat32()` method gets a signed 32-bit float (float) at the specified byte offset from the start of the `DataView`. */
+ getFloat32(byteOffset: i32, littleEndian?: bool): f32;
+ /** The `getFloat64()` method gets a signed 64-bit float (double) at the specified byte offset from the start of the `DataView`. */
+ getFloat64(byteOffset: i32, littleEndian?: bool): f64;
+ /** The `getInt8()` method gets a signed 8-bit integer (byte) at the specified byte offset from the start of the `DataView`. */
+ getInt8(byteOffset: i32): i8;
+ /** The `getInt16()` method gets a signed 16-bit integer (short) at the specified byte offset from the start of the `DataView`. */
+ getInt16(byteOffset: i32, littleEndian?: bool): i16;
+ /** The `getInt32()` method gets a signed 32-bit integer (long) at the specified byte offset from the start of the `DataView`. */
+ getInt32(byteOffset: i32, littleEndian?: bool): i32;
+ /** The `getInt64()` method gets a signed 64-bit integer (long long) at the specified byte offset from the start of the `DataView`. */
+ getInt64(byteOffset: i32, littleEndian?: bool): i64;
+ /** The `getUint8()` method gets an unsigned 8-bit integer (unsigned byte) at the specified byte offset from the start of the `DataView`. */
+ getUint8(byteOffset: i32): u8;
+ /** The `getUint16()` method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the `DataView`. */
+ getUint16(byteOffset: i32, littleEndian?: bool): u16;
+ /** The `getUint32()` method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the `DataView`. */
+ getUint32(byteOffset: i32, littleEndian?: bool): u32;
+ /** The `getUint64()` method gets an unsigned 64-bit integer (unsigned long long) at the specified byte offset from the start of the `DataView`. */
+ getUint64(byteOffset: i32, littleEndian?: bool): u64;
+ /** The `setFloat32()` method stores a signed 32-bit float (float) value at the specified byte offset from the start of the `DataView`. */
+ setFloat32(byteOffset: i32, value: f32, littleEndian?: bool): void;
+ /** The `setFloat64()` method stores a signed 64-bit float (double) value at the specified byte offset from the start of the `DataView`. */
+ setFloat64(byteOffset: i32, value: f64, littleEndian?: bool): void;
+ /** The `setInt8()` method stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the `DataView`. */
+ setInt8(byteOffset: i32, value: i8): void;
+ /** The `setInt16()` method stores a signed 16-bit integer (short) value at the specified byte offset from the start of the `DataView`. */
+ setInt16(byteOffset: i32, value: i16, littleEndian?: bool): void;
+ /** The `setInt32()` method stores a signed 32-bit integer (long) value at the specified byte offset from the start of the `DataView`. */
+ setInt32(byteOffset: i32, value: i32, littleEndian?: bool): void;
+ /** The `setInt64()` method stores a signed 64-bit integer (long long) value at the specified byte offset from the start of the `DataView`. */
+ setInt64(byteOffset: i32, value: i64, littleEndian?: bool): void;
+ /** The `setUint8()` method stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the `DataView`. */
+ setUint8(byteOffset: i32, value: u8): void;
+ /** The `setUint16()` method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the `DataView`. */
+ setUint16(byteOffset: i32, value: u16, littleEndian?: bool): void;
+ /** The `setUint32()` method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the `DataView`. */
+ setUint32(byteOffset: i32, value: u32, littleEndian?: bool): void;
+ /** The `setUint64()` method stores an unsigned 64-bit integer (unsigned long long) value at the specified byte offset from the start of the `DataView`. */
+ setUint64(byteOffset: i32, value: u64, littleEndian?: bool): void;
+ /** Returns a string representation of DataView. */
+ toString(): string;
+}
+
+interface ArrayLike {
+ [key: number]: T;
+ length: i32;
+}
+
+/** Interface for a typed view on an array buffer. */
+interface ArrayBufferView {
+ /** The {@link ArrayBuffer} referenced by this view. */
+ readonly buffer: ArrayBuffer;
+ /** The offset in bytes from the start of the referenced {@link ArrayBuffer}. */
+ readonly byteOffset: i32;
+ /** The length in bytes from the start of the referenced {@link ArrayBuffer}. */
+ readonly byteLength: i32;
+ /** Returns raw pointer to data storage including offset (unsafe). */
+ readonly dataStart: usize;
+}
+
+/** @internal */
+declare abstract class TypedArray implements ArrayBufferView {
+ [key: number]: T;
+ /** Number of bytes per element. */
+ static readonly BYTES_PER_ELEMENT: usize;
+ /** Constructs a new typed array. */
+ constructor(length: i32);
+ /** The {@link ArrayBuffer} referenced by this view. */
+ readonly buffer: ArrayBuffer;
+ /** The offset in bytes from the start of the referenced {@link ArrayBuffer}. */
+ readonly byteOffset: i32;
+ /** The length in bytes from the start of the referenced {@link ArrayBuffer}. */
+ readonly byteLength: i32;
+ /** Returns raw pointer to data storage including offset (unsafe). */
+ readonly dataStart: usize;
+ /** The length (in elements). */
+ readonly length: i32;
+ /** Returns value using relative indexing. Index may be negative */
+ at(index: i32): T;
+ /** The includes() method determines whether a typed array includes a certain element, returning true or false as appropriate. */
+ includes(searchElement: T, fromIndex?: i32): bool;
+ /** The indexOf() method returns the first index at which a given element can be found in the typed array, or -1 if it is not present. */
+ indexOf(searchElement: T, fromIndex?: i32): i32;
+ /** The lastIndexOf() method returns the last index at which a given element can be found in the typed array, or -1 if it is not present. The typed array is searched backwards, starting at fromIndex. */
+ lastIndexOf(searchElement: T, fromIndex?: i32): i32;
+ /** Returns copied section of an TypedArray from begin inclusive to end exclusive */
+ slice(begin?: i32, end?: i32): TypedArray;
+ /** Returns a new TypedArray of this type on the same ArrayBuffer from begin inclusive to end exclusive. */
+ subarray(begin?: i32, end?: i32): TypedArray;
+ /** The copyWithin() method copies the sequence of array elements within the array to the position starting at target. The copy is taken from the index positions of the second and third arguments start and end. The end argument is optional and defaults to the length of the array. */
+ copyWithin(target: i32, start: i32, end?: i32): this;
+ /** The reduce() method applies a function against an accumulator and each value of the typed array (from left-to-right) has to reduce it to a single value. This method has the same algorithm as Array.prototype.reduce(). */
+ reduce(
+ callbackfn: (accumulator: U, value: T, index: i32, self: this) => U,
+ initialValue: U
+ ): U;
+ /** The reduceRight() method applies a function against an accumulator and each value of the typed array (from left-to-right) has to reduce it to a single value, starting from the end of the array. This method has the same algorithm as Array.prototype.reduceRight(). */
+ reduceRight(
+ callbackfn: (accumulator: U, value: T, index: i32, self: this) => U,
+ initialValue: U
+ ): U;
+ /** The some() method tests whether some element in the typed array passes the test implemented by the provided function. This method has the same algorithm as Array.prototype.some().*/
+ some(callbackfn: (value: T, index: i32, self: this) => bool): bool;
+ /** The map() method creates a new typed array with the results of calling a provided function on every element in this typed array. This method has the same algorithm as Array.prototype.map().*/
+ map(callbackfn: (value: T, index: i32, self: this) => T): TypedArray;
+ /** The filter() method creates a new typed array with all elements that pass the test implemented by the provided function. This method has the same algorithm as Array.prototype.filter(). */
+ filter(callbackfn: (value: T, index: i32, self: this) => bool): TypedArray;
+ /** The sort() method sorts the elements of a typed array numerically in place and returns the typed array. This method has the same algorithm as Array.prototype.sort(), except that sorts the values numerically instead of as strings. TypedArray is one of the typed array types here. */
+ sort(callback?: (a: T, b: T) => i32): this;
+ /** The fill() method fills all the elements of a typed array from a start index to an end index with a static value. This method has the same algorithm as Array.prototype.fill(). */
+ fill(value: T, start?: i32, end?: i32): this;
+ /** The findIndex() method returns an index in the typed array, if an element in the typed array satisfies the provided testing function. Otherwise -1 is returned. See also the find() [not implemented] method, which returns the value of a found element in the typed array instead of its index. */
+ findIndex(callbackfn: (value: T, index: i32, self: this) => bool): i32;
+ /** The findLastIndex() method returns an index start searching from the end in the typed array, if an element in the typed array satisfies the provided testing function. Otherwise -1 is returned. See also the find() [not implemented] method, which returns the value of a found element in the typed array instead of its index. */
+ findLastIndex(callbackfn: (value: T, index: i32, self: this) => bool): i32;
+ /** The every() method tests whether all elements in the typed array pass the test implemented by the provided function. This method has the same algorithm as Array.prototype.every(). */
+ every(callbackfn: (value: T, index: i32, self: this) => bool): bool;
+ /** The forEach() method executes a provided function once per array element. This method has the same algorithm as Array.prototype.forEach().*/
+ forEach(callbackfn: (value: T, index: i32, self: this) => void): void;
+ /** The reverse() method reverses a typed array in place. The first typed array element becomes the last and the last becomes the first. This method has the same algorithm as Array.prototype.reverse(). */
+ reverse(): this;
+ /** The join() method joins all elements of an array into a string. This method has the same algorithm as Array.prototype.join(). */
+ join(separator?: string): string;
+ /** The set() method stores multiple values in the typed array, reading input values from a specified array. */
+ set(source: U, offset?: i32): void;
+ /** The toString() method returns a string representing the specified array and its elements. This method has the same algorithm as Array.prototype.toString() */
+ toString(): string;
+}
+
+/** An array of twos-complement 8-bit signed integers. */
+declare class Int8Array extends TypedArray {
+ /** Wrap an ArrayBuffer */
+ static wrap(buffer: ArrayBuffer, byteOffset?: i32, length?: i32): Int8Array;
+}
+/** An array of 8-bit unsigned integers. */
+declare class Uint8Array extends TypedArray {
+ /** Wrap an ArrayBuffer */
+ static wrap(buffer: ArrayBuffer, byteOffset?: i32, length?: i32): Uint8Array;
+}
+/** A clamped array of 8-bit unsigned integers. */
+declare class Uint8ClampedArray extends TypedArray {
+ /** Wrap an ArrayBuffer */
+ static wrap(
+ buffer: ArrayBuffer,
+ byteOffset?: i32,
+ length?: i32
+ ): Uint8ClampedArray;
+}
+/** An array of twos-complement 16-bit signed integers. */
+declare class Int16Array extends TypedArray {
+ /** Wrap an ArrayBuffer */
+ static wrap(buffer: ArrayBuffer, byteOffset?: i32, length?: i32): Int16Array;
+}
+/** An array of 16-bit unsigned integers. */
+declare class Uint16Array extends TypedArray {
+ /** Wrap an ArrayBuffer */
+ static wrap(buffer: ArrayBuffer, byteOffset?: i32, length?: i32): Uint16Array;
+}
+/** An array of twos-complement 32-bit signed integers. */
+declare class Int32Array extends TypedArray {
+ /** Wrap an ArrayBuffer */
+ static wrap(buffer: ArrayBuffer, byteOffset?: i32, length?: i32): Int32Array;
+}
+/** An array of 32-bit unsigned integers. */
+declare class Uint32Array extends TypedArray {
+ /** Wrap an ArrayBuffer */
+ static wrap(buffer: ArrayBuffer, byteOffset?: i32, length?: i32): Uint32Array;
+}
+/** An array of twos-complement 64-bit signed integers. */
+declare class Int64Array extends TypedArray {
+ /** Wrap an ArrayBuffer */
+ static wrap(buffer: ArrayBuffer, byteOffset?: i32, length?: i32): Int64Array;
+}
+/** An array of 64-bit unsigned integers. */
+declare class Uint64Array extends TypedArray {
+ /** Wrap an ArrayBuffer */
+ static wrap(buffer: ArrayBuffer, byteOffset?: i32, length?: i32): Uint64Array;
+}
+/** An array of 32-bit floating point numbers. */
+declare class Float32Array extends TypedArray {
+ /** Wrap an ArrayBuffer */
+ static wrap(
+ buffer: ArrayBuffer,
+ byteOffset?: i32,
+ length?: i32
+ ): Float32Array;
+}
+/** An array of 64-bit floating point numbers. */
+declare class Float64Array extends TypedArray {
+ /** Wrap an ArrayBuffer */
+ static wrap(
+ buffer: ArrayBuffer,
+ byteOffset?: i32,
+ length?: i32
+ ): Float64Array;
+}
+
+/** Class representing a sequence of values of type `T`. */
+declare class Array {
+ /** Tests if a value is an array. */
+ static isArray(value: any): value is Array;
+
+ [key: number]: T;
+ /** Current length of the array. */
+ length: i32;
+ /** Returns raw pointer to data storage (unsafe). */
+ readonly dataStart: usize;
+ /** Constructs a new array. */
+ constructor(length?: i32);
+ at(index: i32): T;
+ fill(value: T, start?: i32, end?: i32): this;
+ findIndex(callbackfn: (value: T, index: i32, array: Array) => bool): i32;
+ findLastIndex(
+ callbackfn: (value: T, index: i32, array: Array) => bool
+ ): i32;
+ includes(searchElement: T, fromIndex?: i32): bool;
+ indexOf(searchElement: T, fromIndex?: i32): i32;
+ lastIndexOf(searchElement: T, fromIndex?: i32): i32;
+ push(element: T): i32;
+ concat(items: T[]): T[];
+ copyWithin(target: i32, start: i32, end?: i32): this;
+ pop(): T;
+ forEach(callbackfn: (value: T, index: i32, array: Array) => void): void;
+ map(callbackfn: (value: T, index: i32, array: Array) => U): Array;
+ filter(callbackfn: (value: T, index: i32, array: Array) => bool): Array;
+ reduce(
+ callbackfn: (
+ previousValue: U,
+ currentValue: T,
+ currentIndex: i32,
+ array: Array
+ ) => U,
+ initialValue: U
+ ): U;
+ reduceRight(
+ callbackfn: (
+ previousValue: U,
+ currentValue: T,
+ currentIndex: i32,
+ array: Array
+ ) => U,
+ initialValue: U
+ ): U;
+ every(callbackfn: (value: T, index: i32, array: Array) => bool): bool;
+ some(callbackfn: (value: T, index: i32, array: Array) => bool): bool;
+ shift(): T;
+ unshift(element: T): i32;
+ slice(from: i32, to?: i32): Array;
+ splice(start: i32, deleteCount?: i32): Array;
+ sort(comparator?: (a: T, b: T) => i32): this;
+ join(separator?: string): string;
+ reverse(): this;
+ /** Flattens an array of arrays. If any null entries exist in the array, they are ignored, unlike JavaScript's version of Array#flat(). */
+ flat(): T extends unknown[] ? T : never;
+ toString(): string;
+}
+
+/** Class representing a static (not resizable) sequence of values of type `T`. This class is @final. */
+declare class StaticArray {
+ [key: number]: T;
+ static fromArray(source: Array): StaticArray;
+ static concat(
+ source: StaticArray,
+ other: StaticArray
+ ): StaticArray;
+ static slice(
+ source: StaticArray,
+ start?: i32,
+ end?: i32
+ ): StaticArray;
+ readonly length: i32;
+ constructor(length?: i32);
+ at(index: i32): T;
+ fill(value: T, start?: i32, end?: i32): this;
+ findIndex(
+ callbackfn: (value: T, index: i32, array: StaticArray) => bool
+ ): i32;
+ findLastIndex(
+ callbackfn: (value: T, index: i32, array: StaticArray) => bool
+ ): i32;
+ copyWithin(target: i32, start: i32, end?: i32): this;
+ includes(searchElement: T, fromIndex?: i32): bool;
+ indexOf(searchElement: T, fromIndex?: i32): i32;
+ lastIndexOf(searchElement: T, fromIndex?: i32): i32;
+ forEach(
+ callbackfn: (value: T, index: i32, array: StaticArray) => void
+ ): void;
+ map(
+ callbackfn: (value: T, index: i32, array: StaticArray) => U
+ ): Array;
+ filter(
+ callbackfn: (value: T, index: i32, array: StaticArray) => bool
+ ): Array;
+ reduce(
+ callbackfn: (
+ previousValue: U,
+ currentValue: T,
+ currentIndex: i32,
+ array: StaticArray
+ ) => U,
+ initialValue: U
+ ): U;
+ reduceRight(
+ callbackfn: (
+ previousValue: U,
+ currentValue: T,
+ currentIndex: i32,
+ array: StaticArray
+ ) => U,
+ initialValue: U
+ ): U;
+ every(
+ callbackfn: (value: T, index: i32, array: StaticArray) => bool
+ ): bool;
+ some(callbackfn: (value: T, index: i32, array: StaticArray) => bool): bool;
+ concat(items: Array): Array;
+ slice(from: i32, to?: i32): Array;
+ sort(comparator?: (a: T, b: T) => i32): this;
+ join(separator?: string): string;
+ reverse(): this;
+ toString(): string;
+}
+
+/** Class representing a sequence of characters. */
+declare class String {
+ static fromCharCode(ls: i32, hs?: i32): string;
+ static fromCharCodes(arr: u16[]): string;
+ static fromCodePoint(code: i32): string;
+ static fromCodePoints(arr: i32[]): string;
+ static raw(parts: TemplateStringsArray, ...args: any[]): string;
+ readonly length: i32;
+ at(index: i32): string;
+ charAt(index: i32): string;
+ charCodeAt(index: i32): i32;
+ codePointAt(index: i32): i32;
+ concat(other: string): string;
+ endsWith(other: string): bool;
+ indexOf(other: string, fromIndex?: i32): i32;
+ lastIndexOf(other: string, fromIndex?: i32): i32;
+ localeCompare(other: string): i32;
+ includes(other: string): bool;
+ startsWith(other: string): bool;
+ substr(start: i32, length?: i32): string;
+ substring(start: i32, end?: i32): string;
+ trim(): string;
+ trimLeft(): string;
+ trimRight(): string;
+ trimStart(): string;
+ trimEnd(): string;
+ padStart(targetLength: i32, padString?: string): string;
+ padEnd(targetLength: i32, padString?: string): string;
+ repeat(count?: i32): string;
+ replace(search: string, replacement: string): string;
+ replaceAll(search: string, replacement: string): string;
+ slice(beginIndex: i32, endIndex?: i32): string;
+ split(separator?: string, limit?: i32): string[];
+ toLowerCase(): string;
+ toUpperCase(): string;
+ toString(): string;
+}
+
+declare namespace String {
+ /** Encoding helpers for UTF-8. */
+ export namespace UTF8 {
+ /** UTF-8 encoding error modes. */
+ export const enum ErrorMode {
+ /** Keeps unpaired surrogates as of WTF-8. This is the default. */
+ WTF8,
+ /** Replaces unpaired surrogates with the replacement character (U+FFFD). */
+ REPLACE,
+ /** Throws an error on unpaired surrogates. */
+ ERROR,
+ }
+ /** Calculates the byte length of the specified string when encoded as UTF-8, optionally null terminated. */
+ export function byteLength(str: string, nullTerminated?: bool): i32;
+ /** Encodes the specified string to UTF-8 bytes, optionally null terminated. ErrorMode defaults to WTF-8. */
+ export function encode(
+ str: string,
+ nullTerminated?: bool,
+ errorMode?: ErrorMode
+ ): ArrayBuffer;
+ /** Encodes the specified raw string to UTF-8 bytes, opionally null terminated. ErrorMode defaults to WTF-8. Returns the number of bytes written. */
+ export function encodeUnsafe(
+ str: usize,
+ len: i32,
+ buf: usize,
+ nullTerminated?: bool,
+ errorMode?: ErrorMode
+ ): usize;
+ /** Decodes the specified buffer from UTF-8 bytes to a string, optionally null terminated. */
+ export function decode(buf: ArrayBuffer, nullTerminated?: bool): string;
+ /** Decodes raw UTF-8 bytes to a string, optionally null terminated. */
+ export function decodeUnsafe(
+ buf: usize,
+ len: usize,
+ nullTerminated?: bool
+ ): string;
+ }
+ /** Encoding helpers for UTF-16. */
+ export namespace UTF16 {
+ /** Calculates the byte length of the specified string when encoded as UTF-16. */
+ export function byteLength(str: string): i32;
+ /** Encodes the specified string to UTF-16 bytes. */
+ export function encode(str: string): ArrayBuffer;
+ /** Encodes the specified raw string to UTF-16 bytes. Returns the number of bytes written. */
+ export function encodeUnsafe(str: usize, len: i32, buf: usize): usize;
+ /** Decodes the specified buffer from UTF-16 bytes to a string. */
+ export function decode(buf: ArrayBuffer): string;
+ /** Decodes raw UTF-16 bytes to a string. */
+ export function decodeUnsafe(buf: usize, len: usize): string;
+ }
+}
+
+declare class TemplateStringsArray extends Array {
+ readonly raw: string[];
+}
+
+declare class Object {
+ /** The Object.is() method determines whether two values are the same value. */
+ static is(value1: T, value2: T): bool;
+}
+
+declare class Date {
+ /** Returns the UTC timestamp in milliseconds of the specified date. */
+ static UTC(
+ year: i32,
+ month: i32,
+ day: i32,
+ hour: i32,
+ minute: i32,
+ second: i32,
+ millisecond: i32
+ ): i64;
+ /** Returns the current UTC timestamp in milliseconds. */
+ static now(): i64;
+ /** Parses a string representation of a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC. */
+ static parse(dateString: string): Date;
+ static fromString(dateString: string): Date;
+ /** Constructs a new date object from an UTC timestamp in milliseconds. */
+ constructor(value: i64);
+ /** Returns the UTC timestamp of this date in milliseconds. */
+ getTime(): i64;
+ /** Sets the UTC timestamp of this date in milliseconds. */
+ setTime(value: i64): i64;
+
+ getUTCFullYear(): i32;
+ getUTCMonth(): i32;
+ getUTCDate(): i32;
+ getUTCDay(): i32;
+ getUTCHours(): i32;
+ getUTCMinutes(): i32;
+ getUTCSeconds(): i32;
+ getUTCMilliseconds(): i32;
+
+ setUTCFullYear(value: i32): void;
+ setUTCMonth(value: i32): void;
+ setUTCDate(value: i32): void;
+ setUTCHours(value: i32): void;
+ setUTCMinutes(value: i32): void;
+ setUTCSeconds(value: i32): void;
+ setUTCMilliseconds(value: i32): void;
+
+ toString(): string;
+ toISOString(): string;
+ toUTCString(): string;
+ toDateString(): string;
+ toTimeString(): string;
+}
+
+/** Class for representing a runtime error. Base class of all errors. */
+declare class Error {
+ /** Error name. */
+ name: string;
+
+ /** Message provided on construction. */
+ message: string;
+
+ /** Stack trace. */
+ stack?: string;
+
+ /** Constructs a new error, optionally with a message. */
+ constructor(message?: string);
+
+ /** Method returns a string representing the specified Error class. */
+ toString(): string;
+}
+
+/** Class for indicating an error when a value is not in the set or range of allowed values. */
+declare class RangeError extends Error {}
+
+/** Class for indicating an error when a value is not of the expected type. */
+declare class TypeError extends Error {}
+
+/** Class for indicating an error when trying to interpret syntactically invalid code. */
+declare class SyntaxError extends Error {}
+
+/** Class for indicating an error when a global URI handling function was used in a wrong way. */
+declare class URIError extends Error {}
+
+interface Boolean {
+ toString(radix?: number): string;
+}
+
+interface Number {
+ toString(radix?: number): string;
+}
+
+interface Function {
+ /** Function table index. */
+ readonly index: u32;
+ /** Function name. Always an empty string. */
+ readonly name: string;
+ /** Number of expected parameters. */
+ readonly length: u32;
+ /** Calls this function indirectly with the specified arguments. */
+ call(thisArg: unknown, ...args: unknown[]): any;
+ /** Returns a string representation of this function. */
+ toString(): string;
+}
+interface IArguments {}
+interface RegExp {}
+
+declare class Map {
+ readonly size: i32;
+ has(key: K): bool;
+ set(key: K, value: V): this;
+ get(key: K): V;
+ delete(key: K): bool;
+ clear(): void;
+ keys(): K[]; // preliminary
+ values(): V[]; // preliminary
+ toString(): string;
+}
+
+declare class Set {
+ readonly size: i32;
+ has(value: K): bool;
+ add(value: K): this;
+ delete(value: K): bool;
+ clear(): void;
+ values(): K[]; // preliminary
+ toString(): string;
+}
+
+interface SymbolConstructor {
+ readonly hasInstance: symbol;
+ readonly isConcatSpreadable: symbol;
+ readonly isRegExp: symbol;
+ readonly iterator: symbol;
+ readonly match: symbol;
+ readonly replace: symbol;
+ readonly search: symbol;
+ readonly species: symbol;
+ readonly split: symbol;
+ readonly toPrimitive: symbol;
+ readonly toStringTag: symbol;
+ readonly unscopables: symbol;
+ (description?: string | null): symbol;
+ for(key: string): symbol;
+ keyFor(sym: symbol): string | null;
+}
+
+declare const Symbol: SymbolConstructor;
+
+/** @internal */
+interface IMath {
+ /** The base of natural logarithms, e, approximately 2.718. */
+ readonly E: T;
+ /** The natural logarithm of 2, approximately 0.693. */
+ readonly LN2: T;
+ /** The natural logarithm of 10, approximately 2.302. */
+ readonly LN10: T;
+ /** The base 2 logarithm of e, approximately 1.442. */
+ readonly LOG2E: T;
+ /** The base 10 logarithm of e, approximately 0.434. */
+ readonly LOG10E: T;
+ /** The ratio of the circumference of a circle to its diameter, approximately 3.14159. */
+ readonly PI: T;
+ /** The square root of 1/2, approximately 0.707. */
+ readonly SQRT1_2: T;
+ /** The square root of 2, approximately 1.414. */
+ readonly SQRT2: T;
+ /** Returns the absolute value of `x`. */
+ abs(x: T): T;
+ /** Returns the arccosine (in radians) of `x`. */
+ acos(x: T): T;
+ /** Returns the hyperbolic arc-cosine of `x`. */
+ acosh(x: T): T;
+ /** Returns the arcsine (in radians) of `x`. */
+ asin(x: T): T;
+ /** Returns the hyperbolic arcsine of `x`. */
+ asinh(x: T): T;
+ /** Returns the arctangent (in radians) of `x`. */
+ atan(x: T): T;
+ /** Returns the arctangent of the quotient of its arguments. */
+ atan2(y: T, x: T): T;
+ /** Returns the hyperbolic arctangent of `x`. */
+ atanh(x: T): T;
+ /** Returns the cube root of `x`. */
+ cbrt(x: T): T;
+ /** Returns the smallest integer greater than or equal to `x`. */
+ ceil(x: T): T;
+ /** Returns the number of leading zero bits in the 32-bit binary representation of `x`. */
+ clz32(x: T): T;
+ /** Returns the cosine (in radians) of `x`. */
+ cos(x: T): T;
+ /** Returns the hyperbolic cosine of `x`. */
+ cosh(x: T): T;
+ /** Returns e to the power of `x`. */
+ exp(x: T): T;
+ /** Returns e to the power of `x`, minus 1. */
+ expm1(x: T): T;
+ /** Returns the largest integer less than or equal to `x`. */
+ floor(x: T): T;
+ /** Returns the nearest 32-bit single precision float representation of `x`. */
+ fround(x: T): T;
+ /** Returns the square root of the sum of squares of its arguments. */
+ hypot(value1: T, value2: T): T; // TODO: rest
+ /** Returns the result of the C-like 32-bit multiplication of `a` and `b`. */
+ imul(a: T, b: T): T;
+ /** Returns the natural logarithm (base e) of `x`. */
+ log(x: T): T;
+ /** Returns the base 10 logarithm of `x`. */
+ log10(x: T): T;
+ /** Returns the natural logarithm (base e) of 1 + `x`. */
+ log1p(x: T): T;
+ /** Returns the base 2 logarithm of `x`. */
+ log2(x: T): T;
+ /** Returns the largest-valued number of its arguments. */
+ max(value1: T, value2: T): T; // TODO: rest
+ /** Returns the lowest-valued number of its arguments. */
+ min(value1: T, value2: T): T; // TODO: rest
+ /** Returns `base` to the power of `exponent`. */
+ pow(base: T, exponent: T): T;
+ /** Returns a pseudo-random number in the range from 0.0 inclusive up to but not including 1.0. */
+ random(): T;
+ /** Returns the value of `x` rounded to the nearest integer. */
+ round(x: T): T;
+ /** Returns the sign of `x`, indicating whether the number is positive, negative or zero. */
+ sign(x: T): T;
+ /** Returns whether the sign bit of `x` is set. */
+ signbit(x: T): bool;
+ /** Returns the sine of `x`. */
+ sin(x: T): T;
+ /** Returns the hyperbolic sine of `x`. */
+ sinh(x: T): T;
+ /** Returns the square root of `x`. */
+ sqrt(x: T): T;
+ /** Returns the tangent of `x`. */
+ tan(x: T): T;
+ /** Returns the hyperbolic tangent of `x`. */
+ tanh(x: T): T;
+ /** Returns the integer part of `x` by removing any fractional digits. */
+ trunc(x: T): T;
+}
+
+/** @internal */
+interface INativeMath extends IMath {
+ /** Contains sin value produced after Math/Mathf.sincos */
+ sincos_sin: T;
+ /** Contains cos value produced after Math/Mathf.sincos */
+ sincos_cos: T;
+ /** Seeds the random number generator. */
+ seedRandom(value: i64): void;
+ /** Multiplies a floating point `x` by 2 raised to power exp `n`. */
+ scalbn(x: T, n: i32): T;
+ /** Returns the floating-point remainder of `x / y` (rounded towards zero). */
+ mod(x: T, y: T): T;
+ /** Returns the floating-point remainder of `x / y` (rounded to nearest). */
+ rem(x: T, y: T): T;
+ /** Returns sin and cos simultaneously for same angle. Results stored to `sincos_s32/64` and `sincos_c32/64` globals */
+ sincos(x: T): void;
+ /** Returns 2 raised to the given power x. Equivalent to 2 ** x. */
+ exp2(x: T): T;
+}
+
+/** Double precision math imported from JavaScript. */
+declare const JSMath: IMath;
+/** Double precision math implemented natively. */
+declare const NativeMath: INativeMath;
+/** Single precision math implemented natively. */
+declare const NativeMathf: INativeMath;
+/** Alias of {@link NativeMath} or {@link JSMath} respectively. Defaults to `NativeMath`. */
+declare const Math: IMath;
+/** Alias of {@link NativeMathf} or {@link JSMath} respectively. Defaults to `NativeMathf`. */
+declare const Mathf: IMath;
+
+/** Environmental abort function. */
+declare function abort(
+ msg?: string | null,
+ fileName?: string | null,
+ lineNumber?: i32,
+ columnNumber?: i32
+): never;
+/** Environmental tracing function. */
+declare function trace(
+ msg: string,
+ n?: i32,
+ a0?: f64,
+ a1?: f64,
+ a2?: f64,
+ a3?: f64,
+ a4?: f64
+): void;
+/** Environmental seeding function. */
+declare function seed(): f64;
+
+/** Node-like process on top of WASI. */
+declare namespace process {
+ /** String representing the CPU architecture for which the binary was compiled. Either `wasm32` or `wasm64`. */
+ export const arch: string;
+ /** String representing the operating system platform for which the binary was compiled. Always `wasm`. */
+ export const platform: string;
+ /** Array of command line arguments passed to the binary upon instantiation. */
+ export const argv: string[];
+ /** Map of variables in the binary's user environment. */
+ export const env: Map;
+ /** Process exit code to use when the process exits gracefully. Defaults to `0`. */
+ export var exitCode: i32;
+ /** Terminates the process with either the given exit code, or `process.exitCode` if omitted. */
+ export function exit(code?: i32): void;
+ /** Stream connected to `stdin` (fd `0`). */
+ export const stdin: ReadableStream;
+ /** Stream connected to `stdout` (fd `1`). */
+ export const stdout: WritableStream;
+ /** Stream connected to `stderr` (fd `2`). */
+ export const stderr: WritableStream;
+ /** Obtains the system's current time of day, in milliseconds since Unix epoch. */
+ export function time(): i64;
+ /** Obtains the system's monotonic high resolution time, in nanoseconds since an arbitrary time in the past. */
+ export function hrtime(): u64;
+
+ interface Stream {
+ /** Closes the stream. Throws if already closed or if the stream cannot be closed. */
+ close(): void;
+ }
+ interface ReadableStream extends Stream {
+ /** Reads available data from the stream, into `buffer` at offset `offset`, returning the number of bytes read. */
+ read(buffer: ArrayBuffer, offset?: isize): i32;
+ }
+ interface WritableStream extends Stream {
+ /** Writes string or buffer to the stream. */
+ write(data: T): void;
+ }
+}
+
+/** Browser-like console on top of WASI. */
+declare namespace console {
+ /** Logs `message` to console if `assertion` is false-ish. */
+ export function assert(assertion: T, message?: string): void;
+ /** Outputs `message` to the console. */
+ export function log(message?: string): void;
+ /** Outputs `message` to the console, prefixed with "Debug:". */
+ export function debug(message?: string): void;
+ /** Outputs `message` to the console, prefixed with "Info:". */
+ export function info(message?: string): void;
+ /** Outputs `message` to the console, prefixed with "Warning:". */
+ export function warn(message?: string): void;
+ /** Outputs `message` to the console, prefixed with "Error:". */
+ export function error(message?: string): void;
+ /** Starts a new timer using the specified `label`. */
+ export function time(label?: string): void;
+ /** Logs the current value of a timer previously started with `console.time`. */
+ export function timeLog(label?: string): void;
+ /** Logs the current value of a timer previously started with `console.time` and discards the timer. */
+ export function timeEnd(label?: string): void;
+}
+
+/** Browser-like crypto utilities on top of WASI. */
+declare namespace crypto {
+ /** Fills `array` with cryptographically strong random values. */
+ export function getRandomValues(array: Uint8Array): void;
+}
+
+// Decorators
+
+interface TypedPropertyDescriptor {
+ configurable?: boolean;
+ enumerable?: boolean;
+ writable?: boolean;
+ value?: T;
+ get?(): T;
+ set?(value: T): void;
+}
+
+/** Annotates a method as a binary operator overload for the specified `token`. */
+declare function operator(
+ token:
+ | "[]"
+ | "[]="
+ | "{}"
+ | "{}="
+ | "=="
+ | "!="
+ | ">"
+ | "<"
+ | "<="
+ | ">="
+ | ">>"
+ | ">>>"
+ | "<<"
+ | "&"
+ | "|"
+ | "^"
+ | "+"
+ | "-"
+ | "*"
+ | "**"
+ | "/"
+ | "%"
+): (
+ target: any,
+ propertyKey: string,
+ descriptor: TypedPropertyDescriptor
+) => TypedPropertyDescriptor | void;
+
+declare namespace operator {
+ /** Annotates a method as a binary operator overload for the specified `token`. */
+ export function binary(
+ token:
+ | "[]"
+ | "[]="
+ | "{}"
+ | "{}="
+ | "=="
+ | "!="
+ | ">"
+ | "<"
+ | "<="
+ | ">="
+ | ">>"
+ | ">>>"
+ | "<<"
+ | "&"
+ | "|"
+ | "^"
+ | "+"
+ | "-"
+ | "*"
+ | "**"
+ | "/"
+ | "%"
+ ): (
+ target: any,
+ propertyKey: string,
+ descriptor: TypedPropertyDescriptor
+ ) => TypedPropertyDescriptor | void;
+ /** Annotates a method as an unary prefix operator overload for the specified `token`. */
+ export function prefix(
+ token: "!" | "~" | "+" | "-" | "++" | "--"
+ ): (
+ target: any,
+ propertyKey: string,
+ descriptor: TypedPropertyDescriptor
+ ) => TypedPropertyDescriptor | void;
+ /** Annotates a method as an unary postfix operator overload for the specified `token`. */
+ export function postfix(
+ token: "++" | "--"
+ ): (
+ target: any,
+ propertyKey: string,
+ descriptor: TypedPropertyDescriptor
+ ) => TypedPropertyDescriptor | void;
+}
+
+/** Annotates an element as a program global. */
+declare function global(...args: any[]): any;
+
+/** Annotates a class as being unmanaged with limited capabilities. */
+declare function unmanaged(constructor: Function): void;
+
+/** Annotates a class as being final / non-derivable. */
+declare function final(constructor: Function): void;
+
+/** Annotates a method, function or constant global as always inlined. */
+declare function inline(...args: any[]): any;
+
+/** Annotates a method, function or constant global as unsafe. */
+declare function unsafe(...args: any[]): any;
+
+/** Annotates an explicit external name of a function or global. */
+declare function external(...args: any[]): any;
+
+/** Annotates a global for lazy compilation. */
+declare function lazy(...args: any[]): any;
diff --git a/packages/ens-subgraph/src/@types/assembly/package.json b/packages/ens-subgraph/src/@types/assembly/package.json
new file mode 100644
index 000000000..8308a2f4b
--- /dev/null
+++ b/packages/ens-subgraph/src/@types/assembly/package.json
@@ -0,0 +1,3 @@
+{
+ "types": "index.d.ts"
+}
\ No newline at end of file
diff --git a/packages/ens-subgraph/src/@types/es5/index.d.ts b/packages/ens-subgraph/src/@types/es5/index.d.ts
new file mode 100644
index 000000000..cc4f5b1e3
--- /dev/null
+++ b/packages/ens-subgraph/src/@types/es5/index.d.ts
@@ -0,0 +1,139 @@
+// These types are taken from typescript/lib/lib.es5.d.ts
+// Needed to make the compiler happy
+
+type ThisParameterType = T extends (this: infer U, ...args: never) => any
+ ? U
+ : unknown;
+type OmitThisParameter = unknown extends ThisParameterType
+ ? T
+ : T extends (...args: infer A) => infer R
+ ? (...args: A) => R
+ : T;
+
+declare interface CallableFunction extends Function {
+ /**
+ * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
+ * @param thisArg The object to be used as the this object.
+ * @param args An array of argument values to be passed to the function.
+ */
+ apply(this: (this: T) => R, thisArg: T): R;
+ apply(
+ this: (this: T, ...args: A) => R,
+ thisArg: T,
+ args: A
+ ): R;
+
+ /**
+ * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.
+ * @param thisArg The object to be used as the this object.
+ * @param args Argument values to be passed to the function.
+ */
+ call(
+ this: (this: T, ...args: A) => R,
+ thisArg: T,
+ ...args: A
+ ): R;
+
+ /**
+ * For a given function, creates a bound function that has the same body as the original function.
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
+ * @param thisArg The object to be used as the this object.
+ * @param args Arguments to bind to the parameters of the function.
+ */
+ bind(this: T, thisArg: ThisParameterType): OmitThisParameter;
+ bind(
+ this: (this: T, arg0: A0, ...args: A) => R,
+ thisArg: T,
+ arg0: A0
+ ): (...args: A) => R;
+ bind(
+ this: (this: T, arg0: A0, arg1: A1, ...args: A) => R,
+ thisArg: T,
+ arg0: A0,
+ arg1: A1
+ ): (...args: A) => R;
+ bind(
+ this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R,
+ thisArg: T,
+ arg0: A0,
+ arg1: A1,
+ arg2: A2
+ ): (...args: A) => R;
+ bind(
+ this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R,
+ thisArg: T,
+ arg0: A0,
+ arg1: A1,
+ arg2: A2,
+ arg3: A3
+ ): (...args: A) => R;
+ bind(
+ this: (this: T, ...args: AX[]) => R,
+ thisArg: T,
+ ...args: AX[]
+ ): (...args: AX[]) => R;
+}
+
+declare interface NewableFunction extends Function {
+ /**
+ * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
+ * @param thisArg The object to be used as the this object.
+ * @param args An array of argument values to be passed to the function.
+ */
+ apply(this: new () => T, thisArg: T): void;
+ apply(
+ this: new (...args: A) => T,
+ thisArg: T,
+ args: A
+ ): void;
+
+ /**
+ * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.
+ * @param thisArg The object to be used as the this object.
+ * @param args Argument values to be passed to the function.
+ */
+ call(
+ this: new (...args: A) => T,
+ thisArg: T,
+ ...args: A
+ ): void;
+
+ /**
+ * For a given function, creates a bound function that has the same body as the original function.
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
+ * @param thisArg The object to be used as the this object.
+ * @param args Arguments to bind to the parameters of the function.
+ */
+ bind(this: T, thisArg: any): T;
+ bind